/// <summary> /// Assert that element is not displayed in Web page or doesn't exist in page source. If element is displayed the /// method throws an exception. /// </summary> public void IsNotDisplayed() { _driver.VaftExt().TurnOffImplicitlyWait(); new WebDriverWait(_driver, GetExplicitWait()) { Message = "Element should not be visible. Locator: " + WebElementUtils.GetLocator(_element) }.Until( VaftExpectedConditions.ElementIsNotVisible(_element)); _driver.VaftExt().TurnOnImplicitlyWait(); }
/// <summary>Waits for specified element to be invisible.</summary> public bool WaitUntilInvisible() { _driver.VaftExt().TurnOffImplicitlyWait(); var wait = new WebDriverWait(_driver, GetExplicitWait()) { Message = "Element should be not visible. Locator: " + _locator }.Until( VaftExpectedConditions.ElementIsNotVisible(_element)); _driver.VaftExt().TurnOnImplicitlyWait(); return(wait); }
/// <summary>Waits for specified element to be visible.</summary> public IWebElement WaitUntilVisible() { _driver.VaftExt().TurnOffImplicitlyWait(); var wait = new WebDriverWait(_driver, GetExplicitWait()); wait.Message = "Element should be visible. Locator: " + _locator; var element = wait.Until(VaftExpectedConditions.ElementIsVisible(_element)); _driver.VaftExt().TurnOnImplicitlyWait(); return(element); }
/// <summary>Waits for specified element to be removed from the Web page (DOM).</summary> public void WaitUntilNotExist() { _driver.VaftExt().TurnOffImplicitlyWait(); var wait = new WebDriverWait(_driver, GetExplicitWait()) { Message = "Element should not exist. Locator: " + _locator }; wait.IgnoreExceptionTypes(typeof(StaleElementReferenceException)); wait.Until(VaftExpectedConditions.ElementDoesNotExist(_element)); _driver.VaftExt().TurnOnImplicitlyWait(); }
/// <summary>Assert that element does not exist in page source. If element exists the method throws an exception.</summary> public bool IsNotPresent() { _driver.VaftExt().TurnOffImplicitlyWait(); var wait = new WebDriverWait(_driver, GetExplicitWait()) { Message = "Element should not exist in page source. Locator: " + WebElementUtils.GetLocator(_element) }.Until( VaftExpectedConditions.ElementDoesNotExist(_element)); _driver.VaftExt().TurnOnImplicitlyWait(); return(wait); }