What method can I use in Selenium to wait for a certain element to appear before taking a screenshot?
The code that i am trying is :
The code I already have is
WebDriver driver = new FirefoxDriver();
driver.get(“http://www.site.com”);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
try {
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("/home/Desktop/image.png"));
} catch (Exception e) {
e.printStackTrace();
}
driver.close();
is there another method that I can use to get the driver/page to wait for X amount of seconds?