Skip to content

Instantly share code, notes, and snippets.

@jcarlosgarcia
Created January 3, 2012 16:16
Show Gist options
  • Save jcarlosgarcia/1555569 to your computer and use it in GitHub Desktop.
Save jcarlosgarcia/1555569 to your computer and use it in GitHub Desktop.
Waiting for an element to be loaded with Selenium/WebDriver
(new WebDriverWait(driver, TIMEOUT)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return driver.findElement(By.xpath("myXPathExpression")).isDisplayed();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment