0

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.

  • I think https://playwright.dev/java/docs/screenshots this can help you. and the method mentioned in question is with cucumber. You can try playwright with cucumber. – Dilip Meghwal Apr 27 '22 at 12:31
  • Yeah we can use this but saved screenshots are not coming in the allure report – Shilpa k Apr 29 '22 at 04:19

0 Answers0