Skip to content

Instantly share code, notes, and snippets.

@jineshqa
Created December 21, 2016 17:47
Show Gist options
  • Save jineshqa/3f32fcd95ca51c37c3938569be4cb884 to your computer and use it in GitHub Desktop.
Save jineshqa/3f32fcd95ca51c37c3938569be4cb884 to your computer and use it in GitHub Desktop.
//Define fluent wait
FluentWait wait = new FluentWait(driver)
.withTimeout(15, TimeUnit.SECONDS)
.pollingEvery(1,TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class);
wait.until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
Long loadingStripCount = (Long)((JavascriptExecutor) driver).executeScript("return $('.k-loading-image').length;");
return loadingStripCount < 1 ;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment