Esempio n. 1
0
 protected File takeScreenshotInMemory(TakesScreenshot driver) {
   try {
     return driver.getScreenshotAs(FILE);
   } catch (Exception e) {
     printOnce("takeScreenshotAsFile", e);
     return null;
   }
 }
Esempio 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;
   }
 }