Skip to main content

[SpecFlow + LivingDoc] Include screenshot of failed tests



  • Official comment
    Mario Steiner

    Update: Under consideration

    thanks, everyone for your interest and your feedback regarding the support of screenshots for failed scenarios/tests.

    In general, we have seen that our latest product enhancements have been picked up quite well by the community and we are currently evaluating how we can further improve SpecFlow+ LivingDoc for you.

  • Riškovs, Lauris

    This is super important for us to migrate to LivingDoc as our current setup has screenshots

  • Gavrilovs, Jevgēnijs

    Screenshots help to realize the problem in tests much faster. Would be very nice to have this feature. 

  • Andrew Knight

    Adding screenshots to LivingDoc for failed steps would be awesome. Currently, my team and I use an edited version of the SpecFlow+ report from SpecFlow+ Runner in which we capture and embed screenshots in the HTML. It makes a HUGE improvement in how we analyze and triage failures.

    As a hack, I tried to embed an HTML img tag with an image path in an exception message. However, when I generated the LivingDoc report, the exception message appeared as a failure for the correct step, but the HTML code was displayed as a literal string, not as embedded HTML. This is probably a good thing for security, but it means we cannot hack a screenshot into the report.

    Unfortunately, implementing this could be tricky. One way could be for LivingDoc to search for a specific type of error message format that has a path to a screenshot. Testers would need to make sure that (a) automation code captures screenshot files, (b) automation code puts the right message in the exception, and (c) screenshot paths link up correctly with the generated report. Another way could be for the SpecFlow framework to provide a custom exception type that includes a field for a screenshot path. Nevertheless, testers would still need to handle the three aforementioned cases.

    Ultimately, since screenshots are so valuable, I think it would be beneficial for SpecFlow to add some sort of mechanism to associate screenshots with steps. This idea can be broadened to other test artifacts like logs, REST API request dumps, downloaded files, etc. Essentially, SpecFlow could provide a way to associate artifacts with a step upon completion. Then, those artifacts could be listed or linked from the SpecFlow+ Runner report or the SpecFlow+ LivingDoc report.

  • Vanessa Völk

    Thanks again for your interest and feedback so far. We would like to a closer look at this problem now, for which we appreciate your help. 

    It would be great, if all of you could answer some questions here, so we learn more about your needs.  

    Thanks, we're already excited for your insights!



Please sign in to leave a comment.

Powered by Zendesk