I want to wait for something to load and then take it's screenshot and save it.
Below is the code:
WebDriver driver = new FirefoxDriver();
driver.get("https://www.edureka.co/");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
try {
File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scr,new File("/Desktop/image.png"));
} catch (Exception e) {
e.printStackTrace();
}
driver.close();
The page is not waiting for me, is there any method to get the driver/page to wait for few seconds?