Created
September 23, 2018 14:55
-
-
Save elgatov/479730a7d529ed77395ca82c85ebd20e to your computer and use it in GitHub Desktop.
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
static void _FindingElement(object sender, FindElementEventArgs e) | |
{ | |
wait.Timeout = TimeSpan.FromSeconds(30); | |
wait.PollingInterval = TimeSpan.FromMilliseconds(500); | |
wait.IgnoreExceptionTypes(typeof(NoSuchElementException)); | |
wait.Message = "El Spinner ha tardado demasiado en cargar"; | |
wait.Until(d => | |
{ | |
bool bool1, bool2, bool3; | |
var result1 = ((IJavaScriptExecutor)d).ExecuteScript("return document.readyState"); | |
bool1 = result1.Equals("interactive") || result1.Equals("complete"); | |
bool2 = (bool)((IJavaScriptExecutor)d).ExecuteScript("return !!window.jQuery || jQuery.active === 0"); | |
return bool1 && bool2; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment