Created
January 2, 2017 14:33
-
-
Save musoftware/80ade5993633c3208ccd7e68a6615365 to your computer and use it in GitHub Desktop.
Selenium Wait Loading
This file contains hidden or 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
private void WaitLoading(IWebDriver driver) | |
{ | |
try | |
{ | |
IWait<IWebDriver> waitload = new WebDriverWait(driver, TimeSpan.FromMinutes(15)); | |
waitload.Until<bool>((IWebDriver driver1) => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState", new object[0]).Equals("complete")); | |
} | |
catch | |
{ | |
throw; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment