How to take screenshot using selenium Webdriver?
By Using below code you can take screenshot of current webpage:
driver.get("http://google.com");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("E://google.png"));
Obtained screenshot is of size 999x16476 and is too small,how to obtain screenshot of other sizes
ReplyDeleteHi,
DeleteTry the below code.
driver.manage().window().setSize(new Dimension(1024, 768));