Skip to content

Instantly share code, notes, and snippets.

Created August 12, 2014 16:30
Show Gist options
  • Save anonymous/828a4041e88854301e74 to your computer and use it in GitHub Desktop.
Save anonymous/828a4041e88854301e74 to your computer and use it in GitHub Desktop.
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
.withTimeout(30, TimeUnit.SECONDS)
.pollingEvery(1, TimeUnit.SECONDS)
.ignoreAll(NoSuchWindowException.class, NoSuchElementException.class);
wait.until(new Function<WebDriver, OtherPage>() {
@Override
public WebElement apply(WebDriver input) {
input.switchTo.window("newWindowName");
return new OtherPage(input);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment