Skip to content

Instantly share code, notes, and snippets.

@JamesZoft
Created April 27, 2018 13:38
Show Gist options
  • Save JamesZoft/f4fb190e06543bdcfaa89950f02fbf28 to your computer and use it in GitHub Desktop.
Save JamesZoft/f4fb190e06543bdcfaa89950f02fbf28 to your computer and use it in GitHub Desktop.
<T> T waitUntil(Function<? super WebDriver, T> condition, int timeout, int pollingEvery, Class<? extends Throwable>... exceptions) {
Wait<WebDriver> wait = new FluentWait<>(driver)
.withTimeout(timeout, SECONDS)
.pollingEvery(pollingEvery, MILLISECONDS)
.ignoreAll(Arrays.asList(exceptions));
return wait.until(condition);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment