Skip to main content

[SpecFlow+ LivingDoc] Add a parameter to attach base64 String image on the Specflow ISpecFlowOutputHelper



  • Mario Steiner

    Hi Jonathan,

    thanks a lot for taking the time and sending us your request.

    Are you referring to the new SpecFlow Output API and would like to view the base 64 string directly as an image in SpecFlow+ LivingDoc?

  • Jonathan Pereira

    Yes, I work with Extent reports as well and I don't need to create real images and store them in some folder to do attachment on extent reports, I just create a base64 string image with selenium driver and send to attach reports for the image to be renderer inside the HTML document like this:

    public MediaEntityModelProvider GetScreenshot(IWebDriver webDriver)
    var screenshot = ((ITakesScreenshot)webDriver).GetScreenshot().AsBase64EncodedString;
    return MediaEntityBuilder.CreateScreenCaptureFromBase64String(screenshot).Build();

    _scenario.CreateNode<Then>(scenarioContext.StepContext.StepInfo.Text).Fail(scenarioContext.TestError.Message, GetScreenshot(webDriver));

    This will help to improve living doc API for pipeline tests purpose

  • Andreas Willich

    We discussed this topic when we developed the feature and decided against this. The reason was, that this would generate a very big TestExecution.json file, which will bring us more problems.

    1. Storage in Azure DevOps is limited. We would quickly reach the limit that would be possible to save in Azure DevOps for Extensions

    2. Time for parsing the JSON file is increasing. Some of our users have already very big Living Documentations and have a loading time of multiple seconds


    But that doesn't mean, that we see improvement in this area to make it easier to share a Living Documentation with images. 

    We will start with some examples for various Combinations (Build system, Image Storage, ...) how to do it.

    What are you using? Then we can prioritize the combinations first which are used out there.

  • Jonathan Pereira

    We are not using azure to store images, we are curently working with two different reports, we have integrated Living doc on our azure DevOps and sometimes we run locally to generate the extent reports with attached images.

    But we are on the way to work only with Specflow.

    If you give me another solution to share the failure screenshots using Living Doc on azure I'll aprecciate.

  • Piotr Niedzialek (PL)

    I would like to join to Jonathan's request - embedding of screenshots in Living Docs captured during test execution on remote server would be a nice feature (since SpecRunner doesn't support this one yet). 

  • Andreas Willich

    Jonathan Pereira & Piotr Niedzialek (PL): We published a guide for uploading the images to Azure Blogstorage with Azure DevOps at

    Please let us know if this helps you.

  • Moshe Moadeb

    As someone who also has used Extent report, I have to agree that attaching a base 64 image in the living doc would be very nice and much better than the current options. With Extent HTML report, you are able to send the HTML file that has the 64-bit image embedded in it and there is no need to also send images with it. With LivingDoc you have to give a path to the image and even if you share the HTML report with the images folder the link in the report will be broken since the image path is relative to my system that generated the report. since this is an issue of braking azure is there no way to get base 64 images from a locally generated report?  


Please sign in to leave a comment.

Powered by Zendesk