📜  黄瓜中的屏幕截图 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:29.102000             🧑  作者: Mango

代码示例1
• 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");