I'm using SpecFlow with Selenium WebDriver and SpecRun as test runner to create and execute automated test cases and I'm looking for a solution to insert screenshots in the test execution report.
I wrote a method to create screenshots after every Assert
function. The images are saved to a specific location, but when I make the result analysis I have to follow the report and the images as well. It would be nice to have them in the same location (precisely in the report html).
Is there any way to perform this (something similar to Console outputs)?
(reposting from https://groups.google.com/forum/#!topic/specrun/8-G0TgOBUbY)
Yes, this is possible. You have to do the following steps:
During the report generation, SpecRun scans the test output for such file URLs and convert them to anchor tags with relative path, so that these will work wherever you distribute your report file (as long as the images are next to it). You can of course tup the images to a subfolder as well.
Here is a code snippet that works with Selenium WebDriver. This also saves the HTML source together with the screenshot.