/** * Waits for element to be invisible or not present, or timeout. */ public void waitForElementToDisappear(By by) { waitFor(ExpectedConditions.invisibilityOfElementLocated(by)); }
/** * Returns true if the element is invisible or stale as defined in the WebDriver specification. * @param locator used to find the element */ public boolean isElementInvisibleOrStale(By locator) { return isExpectedCondition(ExpectedConditions.invisibilityOfElementLocated(locator)); }
public Boolean isElemInvisible(By by) { try { return fluentWait.until(invisibilityOfElementLocated(by)); } catch (Exception e) { return FALSE; } }
@Override public void verifyIsHidden() { bobcatWait.until(invisibilityOfElementLocated(LOADER_LOCATOR)); } }
/** * Wait until the element becomes invisible * * @param by locator to search for an item * @param message message in case the element did not disappear after waiting * @param timeout condition timeout in seconds */ public static void invisibility(By by, String message, int timeout) { wait(ExpectedConditions.invisibilityOfElementLocated(by), message, timeout); }
/** * Wait until the element becomes invisible * * @param xpath element xpath * @param message message in case the element did not disappear after waiting * @param timeout condition timeout in seconds */ public static void invisibility(String xpath, String message, int timeout) { wait(ExpectedConditions.invisibilityOfElementLocated(By.xpath(xpath)), message, timeout); }
/** * Waits during {@code timeout}, until {@link WebElement} with provided {@code elementLocator} is * invisible. * * @param elementLocator locator of element which should be checked * @param timeout waiting time in seconds * @throw {@link org.openqa.selenium.TimeoutException} - if visible during timeout. */ public void waitInvisibility(By elementLocator, int timeout) { webDriverWaitFactory.get(timeout).until(invisibilityOfElementLocated(elementLocator)); }
public void shouldNotBeVisible(final By byCriteria) { List<WebElement> matchingElements = getDriver().findElements(byCriteria); if (!matchingElements.isEmpty()) { waitOnPage().until(ExpectedConditions.invisibilityOfElementLocated(byCriteria)); } }
/** * Method can be used to verify if this element is hidden. */ @Override public void verifyIsHidden() { authorLoader.verifyIsHidden(); bobcatWait.until(invisibilityOfElementLocated(By.cssSelector(FORM_CQ_DIALOG))); }
public void shouldNotBeVisible(final By byCriteria) { List<WebElement> matchingElements = getDriver().findElements(byCriteria); if (!matchingElements.isEmpty()) { waitOnPage().until(ExpectedConditions.invisibilityOfElementLocated(byCriteria)); } }
@Override public boolean isComponentNotVisible(String locator, long seconds) { try { WebDriverWait wait = new WebDriverWait(driver, seconds); wait.until(ExpectedConditions.invisibilityOfElementLocated(determineLocator(locator))); return true; } catch (TimeoutException e) { return false; } }
public void shouldNotBeVisible(final By byCriteria) { List<WebElement> matchingElements = getDriver().findElements(byCriteria); if (!matchingElements.isEmpty()) { waitOnPage().until(ExpectedConditions.invisibilityOfElementLocated(byCriteria)); } }
public Locomotive click(By by) { waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); waitForElement(by).click(); return this; }
public Locomotive setText(By by, String text) { waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); WebElement element = waitForElement(by); element.clear(); element.sendKeys(text); return this; }
public static void waitForElementToDisappear(final HtmlElement element) { Assert.assertNotNull(element, "Element can't be null"); TestLogging.logWebStep( "wait for " + element.toString() + " to disappear.", false ); final WebDriverWait wait = new WebDriverWait(WebUIDriver.getWebDriver(), EXPLICT_WAIT_TIMEOUT); wait.until( ExpectedConditions.invisibilityOfElementLocated( element.getBy() ) ); }
public Locomotive check(By by) { if (!isChecked(by)) { waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); waitForElement(by).click(); assertTrue(by.toString() + " did not check!", isChecked(by)); } return this; }
public Locomotive uncheck(By by) { if (isChecked(by)) { waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); waitForElement(by).click(); assertFalse(by.toString() + " did not uncheck!", isChecked(by)); } return this; }
public Locomotive selectOptionByText(By by, String text) { Select box = new Select(waitForElement(by)); waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); box.selectByVisibleText(text); return this; }
public Locomotive selectOptionByValue(By by, String value) { Select box = new Select(waitForElement(by)); waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); box.selectByValue(value); return this; }
@Override public Locomotive selectOptionByIndex(By by, Integer i) { Select box = new Select(waitForElement(by)); waitForCondition(ExpectedConditions.not(ExpectedConditions.invisibilityOfElementLocated(by))) .waitForCondition(ExpectedConditions.elementToBeClickable(by)); box.selectByIndex(i); return this; }