Java Allure Report - Playwright | how to take screenshot on test failure

1.1k Views Asked by At

Selenium : Take screenshot method:

 " if (scenario.isFailed()) {
String screenshotName = scenario.getName().replaceAll(” “, “_”);
try {
TakesScreenshot ts = (TakesScreenshot) driver;
File sourcePath = ts.getScreenshotAs(OutputType.FILE);
File destinationPath = new File(
System.getProperty(“user.dir”) + “\\target\\cucumber-reports\\screenshots\\” + screenshotName + “.png”); "

Takes screenshot method is available is selenium, we need a solution for java+playwright or if allure-selenide also helps.

0

There are 0 best solutions below