Created
December 19, 2016 00:21
-
-
Save kasimok/d1aee51c3a8a845188f1d0140fd276df to your computer and use it in GitHub Desktop.
Selenium Driver take screenshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driver.manage().window().setSize(new Dimension(1920,1080)); | |
driver.get("http://adultimages.org"); | |
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); | |
// Now you can do whatever you need to do with it, for example copy somewhere | |
FileUtils.copyFile(scrFile, new File("./screenshot.png")); | |
driver.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment