Answers for "screenshots in cucumber"

0

screenshots in cucumber

• In myAftermethod I use a code:
• I use TakeScreenShot interface
• You can store screenshot as a byte or file
o @After
public void tearDown(Scenario scenario) {
if(scenario.isFailed()) {
//taking a screenshot
final byte[] screenshot = ((TakesScreenshot)
Driver.getDriver()).getScreenshotAs(OutputType.BYTES);
//adding the screenshot to the report
scenario.embed(screenshot, "image/png");
Posted by: Guest on June-16-2021

Browse Popular Code Answers by Language