I have an error or there is a suite of direct testing when doing a screenshot of an exception. Enter the image in the directory - output . How to do so that the html directory reporter-output is linked to them in the report? Is it possible to add them to specific errors?
If your HTML report is in "test-output" directory and your screenshot "test-output / screenshot "In the directory, then:
(...) string destDir =" test-output / screenshots "; String Dest. = Date format. Format (new date ()) + ".png"; FileUtils.copyFile (scrFile, new file (destDir + "/" + destFile)); Reporter.log ("& lt; a href = / screenshots /" + destFile + "& gt; & lt; img src = / screenshots /" + destFile + "style = width: 100px; height: 100px; / & gt; "+ Dest ++" & lt; / a & gt; & lt; br / & gt; ");
Comments
Post a Comment