Created
May 28, 2019 21:30
-
-
Save elgatov/d3ed3ab02e68cce03d2a664a56470ac6 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
public static IWebElement RetryingFindElement(this IWebDriver driver, By locator) | |
{ | |
//WebDriverWait WaitElement = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); | |
WebDriverWait WaitElement = new EventFiringWebDriverWait(driver, TimeSpan.FromSeconds(10)); | |
return WaitElement.Until(d => | |
{ | |
WaitSpinner(driver); | |
var e = d.FindElement(locator); | |
return (e.Displayed ? e : null); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment