Skip to content

Instantly share code, notes, and snippets.

@huguogang
Created September 29, 2013 06:36
Show Gist options
  • Save huguogang/6749902 to your computer and use it in GitHub Desktop.
Save huguogang/6749902 to your computer and use it in GitHub Desktop.
public waitForAjax(WebDriver driver, int timeOutInSeconds) {
(new WebDriverWait(driver, timeOutInSeconds))
.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return (Boolean) ((JavascriptExecutor) d)
.executeScript("return !(ExtJSUtil.hasActiveAjaxCalls(Ext.Ajax.requests && !_.isEmpty(Ext.Ajax.requests));");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment