I am trying to take screenshot from cucumber-jvm using this code .
if(scenario.isFailed()){
try {
scenario.write("Current Page URL is " + driver.getCurrentUrl());
byte[] screenshot = getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png");
} catch (WebDriverException somePlatformsDontSupportScreenshots) {
System.err.println(somePlatformsDontSupportScreenshots.getMessage());
}
}
Then i will take the report.json and parse it to cucumber sandwitch jar . The Screenshot embedded successfully . But it appears very small . In default cucumber-jvm output html file , it appears good .
Does the size of the image caused by Json byte code ? . Can we make it appear in full size ?