Skip to content

Instantly share code, notes, and snippets.

@ponzao
Created May 19, 2010 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ponzao/406036 to your computer and use it in GitHub Desktop.
Save ponzao/406036 to your computer and use it in GitHub Desktop.
private ExpectedCondition<Boolean> element(final By findCondition) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver from) {
RenderedWebElement element = (RenderedWebElement)
driver.findElement(findCondition);
return element.isDisplayed();
}
};
}
Wait<WebDriver> wait = new WebDriverWait(driver, 60);
wait.until(element(By.id("some_div")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment