How can i show screenshot in reports?

#1

when i used “File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);”, it only show the base64 string in the report. how can i show the screenshot in every test step??

0 Likes

#2

What is the reference of the driver instance ?

I think below should work

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(“c::\tmp\tmp.png”));

Does the second like saves the file ?

0 Likes

#3

Thank you for your reply.

Yes, the image can be saved but it cannot show in the report(index.html)

i hope that the following display.

0 Likes