Ejemplo n.º 1
0
 public static IWebElement FindElementWithRetry(this IWebDriver driver, By by, RetryPolicyFactory policyFactory)
 {
     return(policyFactory.CreateConfiguredRetryPolicy <NoSuchElementException, IWebElement>(
                (elem) => !elem.Displayed)
            .Execute(() =>
     {
         var result = driver.FindElement(by);
         return result;
     }));
 }
Ejemplo n.º 2
0
 public static ReadOnlyCollection <IWebElement> FindElementsWithRetry(this IWebDriver driver, By by, RetryPolicyFactory policyFactory)
 {
     return(policyFactory.CreateConfiguredRetryPolicy <NoSuchElementException, ReadOnlyCollection <IWebElement> >(
                (collection) => collection.Count == 0)
            .Execute(() =>
     {
         var result = driver.FindElements(by);
         return result;
     }));
 }