//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())); }
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))); }
//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))); }
//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))); }
//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))); }
//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))); }
//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))); }