Using this code trying to take screenshot, but Selenium web driver takes screenshot of initial stage page of Webdriver server and not google page
System.setProperty("webdriver.ie.driver", ......"); driver = new InternetExplorerDriver(); driver.manage().window().maximize(); driver.get("http://www.google.com");
File src= ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
try {
FileUtils.copyFile(src, new File("PATH"));
System.out.println("Screenshot taken");
}
catch (IOException e)
{
System.out.println(e.getMessage());
}
Could you please help to resolve this issue. Tried with adding thread.sleep also ut not working. Need screenshot of google home page using above code