Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created August 20, 2020 09:38
Show Gist options
  • Save angelovstanton/ca23ff28ac5a236393b0929a23c45c7d to your computer and use it in GitHub Desktop.
Save angelovstanton/ca23ff28ac5a236393b0929a23c45c7d to your computer and use it in GitHub Desktop.
public void takeFullScreenshot(String fileName) throws Exception {
File srcFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
String tempDir = getProperty("java.io.tmpdir");
File destFile = new File(Paths.get(tempDir, fileName + ".png").toString());
FileUtils.getFileUtils().copyFile(srcFile, destFile);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment