Created
September 24, 2014 19:31
-
-
Save dimacus/41075781108b4ef66f9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wait_for_ajax | |
Selenium::WebDriver::Wait.new(:timeout => 60).until do | |
sleep 1 | |
@selenium.execute_script("return jQuery.active") == 0 | |
end | |
end | |
public void waitForAjax() { | |
new WebDriverWait(selenium, 60000) { | |
}.until(new ExpectedCondition<Boolean>() { | |
@Override | |
public Boolean apply(WebDriver driverObject) { | |
try { | |
Thread.sleep(1000); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
Long | |
returnedValue = | |
(Long) ((JavascriptExecutor) driverObject).executeScript("return jQuery.active"); | |
return returnedValue == 0; | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment