public void waitForElementsVisibility(List<WebElement> elements) { waitFor(ExpectedConditions.visibilityOfAllElements(elements)); }
default ExpectedCondition<List<WebElement>> VISIBLE_ALL(List<WebElement> webElements) { return ExpectedConditions.visibilityOfAllElements(webElements); }
/** * Waits during specified {@code timeout} until all of provided {@code elements}, are visible. * * @param elements web elements which should check * @param timeout waiting time in seconds * @return provided {@code elements}, * <p>throws {@link org.openqa.selenium.TimeoutException} if at least one of the specified * {@code elements} is not visible after timeout; */ public List<WebElement> waitAllVisibility(List<WebElement> elements, int timeout) { return webDriverWaitFactory.get(timeout).until(visibilityOfAllElements(elements)); }
public static void waitForElementsToDisplay(List<? extends WebElement> webElements, long secondsToWait) { WebDriverWait wait = new WebDriverWait(driver(), secondsToWait); wait.until(ExpectedConditions.visibilityOfAllElements((List<WebElement>) webElements)); }
public static void waitForElementsToDisplay(List<? extends WebElement> webElements, long secondsToWait) { WebDriverWait wait = new WebDriverWait(driver(), secondsToWait); wait.until(ExpectedConditions.visibilityOfAllElements((List<WebElement>) webElements)); }
public static void waitForElementsToDisplay(List<? extends WebElement> webElements, long secondsToWait, long sleepInMillis) { WebDriverWait wait = new WebDriverWait(driver(), secondsToWait, sleepInMillis); wait.until(ExpectedConditions.visibilityOfAllElements((List<WebElement>) webElements)); }
public static void waitForElementsToDisplay(List<? extends WebElement> webElements, long secondsToWait, long sleepInMillis) { WebDriverWait wait = new WebDriverWait(driver(), secondsToWait, sleepInMillis); wait.until(ExpectedConditions.visibilityOfAllElements((List<WebElement>) webElements)); }
/** * Checks for visibility of Fields with the {@link Visible} annotation. * Will recurse inside {@link HtmlElement}s * * @param pageObject the pageObject * @param field wait for visibility of the field * @param checkAtMost maximum number of elements to check in a List */ @SuppressWarnings("unchecked") private void waitForFieldToBeVisible(Object pageObject, Field field, int checkAtMost) { Object objectFromField = getObjectFromField(pageObject, field); applyToWebElements( field, objectFromField, we -> wait.until(visibilityOf(we)), list -> wait.until(visibilityOfAllElements( list.stream() .limit(checkAtMost == -1 ? list.size() : checkAtMost) .collect(Collectors.toList())))); // recurse inside HtmlElements if (isHtmlElementList(field)) { ((List<HtmlElement>) objectFromField) .forEach(this::waitForAnnotatedElementVisibility); } else if (isHtmlElement(field)) { waitForAnnotatedElementVisibility(objectFromField); } }
private void verifyResultsVisible() { bobcatWait.tweak(Timings.MEDIUM_EXPLICIT).until(invisibilityOf(resultsLoader)); bobcatWait.tweak(Timings.MEDIUM_EXPLICIT).ignoring(StaleElementReferenceException.class) .until(visibilityOfAllElements(searchResults)); }