示例#1
0
 //Waits untill count of elements containing the class name ".blockUI" is 0, then returns True.
 public static bool WaitForBlockUiOff(IWebDriver Driver, int waitTime = MAX_WAIT_TIME)
 {
     return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <bool>(ExpectedConditionsExtention.WaitForBlockUiOff()));
 }
示例#2
0
        public static bool WaitForJSElementReady(IWebDriver Driver, string locator, int waitTime = MAX_WAIT_TIME)
        {
            if (locator.IsEmpty())
            {
                log.Debug("Selector is not supported fror Jquery validation.");
                return(true);
            }
            IJavaScriptExecutor jsExe = Driver as IJavaScriptExecutor;

            return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <bool>(ExpectedConditionsExtention.WaitForJSElementReady(jsExe, locator)));
        }
示例#3
0
 //Waits untill Jquery.Active==0, then returns True.
 public static bool WaitForAjaxReady(IWebDriver Driver, int waitTime = MAX_WAIT_TIME)
 {
     return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <bool>(ExpectedConditionsExtention.WaitForAjaxReady(Driver as IJavaScriptExecutor)));
 }
示例#4
0
 //Check weather the current Driver's web address contains a sub-string repeatedly.
 public static bool WebAddressContains(IWebDriver Driver, string partialUrl, int waitTime = MAX_WAIT_TIME)
 {
     return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <bool>(ExpectedConditionsExtention.WebAddressContains(partialUrl)));
 }
示例#5
0
 //Switches Driver's focus to the windowCount's opened browser instance.
 public static string LastWindowName(IWebDriver Driver, int windowCount, int waitTime = MAX_WAIT_TIME)
 {
     return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <string>(ExpectedConditionsExtention.LastWindowName(windowCount)));
 }
示例#6
0
 //Awaits an element to be clickable By locator,
 //clicks the element and than asserts By a following locator that the click action was initiated and performed correctly.
 public static bool ClickAssert(IWebDriver Driver, By locator, By assertElement, int waitTime = MAX_WAIT_TIME)
 {
     return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <bool>(ExpectedConditionsExtention.ClickAssert(locator, assertElement)));
 }
示例#7
0
 //Awaits untill element is clickable By locator, returns the element.
 public static IWebElement ElementIsClickable(IWebDriver Driver, By locator, int waitTime = MAX_WAIT_TIME)
 {
     return(new WebDriverWait(Driver, TimeSpan.FromSeconds(waitTime)).Until <IWebElement>(ExpectedConditionsExtention.ElementIsClickable(locator)));
 }