Beispiel #1
0
 /// <summary>
 /// Simple waits for TimeSpan.
 /// Please avoid that unless absolutely needed.
 /// </summary>
 /// <param name="timeOut">Time to wait</param>
 public static void WaitFor(TimeSpan timeOut)
 {
     try
     {
         Waiter.Wait(timeOut).Until <bool>(
             (driver) =>
         {
             return(false);
         });
     }
     catch (WebDriverTimeoutException)
     {
     }
 }
Beispiel #2
0
 public static void WaitForFrameAndSwitchToIt(string frameLocator)
 {
     Waiter.Wait().Until(
         (driver) =>
     {
         try
         {
             return(driver.SwitchTo().Frame(frameLocator));
         }
         catch (NoSuchFrameException e)
         {
             return(null);
         }
     });
 }
Beispiel #3
0
 public static void WaitForInvisibility(By locator, TimeSpan timeOut)
 {
     Waiter.Wait().Until <bool>(
         (driver) =>
     {
         try
         {
             return(!Waiter.WaitForVisibility(locator, timeOut).Displayed);
         }
         catch (Exception)
         {
             return(true);
         }
     });
 }
Beispiel #4
0
 public static IWebElement WaitForExistence(By locator, TimeSpan timeOut)
 {
     return(Waiter.Wait(timeOut).Until(ExpectedConditions.ElementExists(locator)));
 }
Beispiel #5
0
 public static IWebElement WaitForVisibility(By locator, TimeSpan timeOut)
 {
     return(Waiter.Wait(timeOut).Until(ExpectedConditions.ElementIsVisible(locator)));
 }