Skip to content

Instantly share code, notes, and snippets.

@Ardesco
Created January 2, 2013 14:56
Show Gist options
  • Save Ardesco/4435098 to your computer and use it in GitHub Desktop.
Save Ardesco/4435098 to your computer and use it in GitHub Desktop.
Wait until processing of jQuery has completed
public static ExpectedCondition<Boolean> processingOfJQueryHasFinished() {
new ExpectedCondition<Boolean>() {
@Override
Boolean apply(WebDriver driver) {
(Boolean) ((JavascriptExecutor) driver).executeScript("return jQuery.active === 0;")
}
}
}
@lukeis
Copy link

lukeis commented Jan 17, 2013

python:

WebDriverWait(driver, 5).until(lambda d: d.execute_script("return jQuery.active === 0"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment