Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static ExpectedCondition<Boolean> ajaxCompleted = new ExpectedCondition<Boolean>() {
- boolean result;
- @Override
- public Boolean apply(WebDriver driver) {
- try {
- result = (Boolean) ((JavascriptExecutor) driver).executeScript("return typeof($) !== 'undefined' && $.active == 0");
- System.out.println("Ajax return $.active == 0 is: '" + result + "'");
- } catch (Exception e) {
- return false;
- }
- return result;
- }
- public String toString() {
- return "Ajax return $.active == 0 is: '" + result + "'";
- }
Advertisement
Add Comment
Please, Sign In to add comment