Ejemplo n.º 1
0
 protected File takeScreenshotInMemory(TakesScreenshot driver) {
   try {
     return driver.getScreenshotAs(FILE);
   } catch (Exception e) {
     printOnce("takeScreenshotAsFile", e);
     return null;
   }
 }
Ejemplo n.º 2
0
 protected File takeScreenshotImage(TakesScreenshot driver, String fileName) {
   try {
     File scrFile = driver.getScreenshotAs(FILE);
     File imageFile = new File(reportsFolder, fileName + ".png");
     copyFile(scrFile, imageFile);
     return imageFile;
   } catch (Exception e) {
     printOnce("takeScreenshotImage", e);
     return null;
   }
 }