Log in
updated 11:29 AM UTC, May 4, 2016

how to wait in selenium

  • Written by Madhu V Rao
  • Published in Automation

This code snippet has the selenium webdriver (java) code to wait till certain condition occurs. In this case it is waiting till the 'body' tag is present.

 

WebDriverWait wait = new WebDriverWait(driver, 10);
		wait.until(new ExpectedCondition<Boolean>() {
			public Boolean apply(WebDriver wdriver) {
				return driver.findElement(By.tagName("body")) != null;
			}
		});

Powered by Bullraider.com
Follow Us on Twitter
Find Us on Facebook
Follow Us on Google
Follow Us on Pinterest