List of usage examples for org.openqa.selenium.support.ui ExpectedConditions visibilityOfAllElements
public static ExpectedCondition<List<WebElement>> visibilityOfAllElements(final List<WebElement> elements)
From source file:com.ionidea.RegressionNGA.Tests.pages.WidgetWorksOfArtPage.java
/** * //from ww w.j a v a 2s. c o m * @param page - the page * @param list - the list of elements to count across all pages * @return - number of Works of Art * @throws InterruptedException */ public int addToListallWorkObjects(WidgetWorksOfArtPage page, List<WebElement> list, Integer pageNumber, FluentWait wait) throws InterruptedException { int number; // the list will contain elemtns from all pages List<WebElement> entireList = new ArrayList<WebElement>(); entireList.addAll(list); //open all pages one by one and add work objects to the entire list int currentPage = 1; while (currentPage < pageNumber) { Thread.sleep(2000); page.pageButtonNext.get(0).click(); wait.until(ExpectedConditions.visibilityOfAllElements(list)); entireList.addAll(page.artistNameLabels); System.out.println("the entire number is:" + entireList.size()); currentPage++; } System.out.println("The full number of works of art is: 50!"); //get the number of the ojects number = entireList.size(); return number; }
From source file:org.apache.archiva.web.test.parent.AbstractSeleniumTest.java
License:Apache License
public WebElement selectValue(String locator, String value, boolean scrollToView) { int count = 5; boolean check = true; WebDriverWait wait = new WebDriverWait(getWebDriver(), 10); WebElement element = null;//from w ww .j av a2 s.c om while (check && count-- > 0) { try { element = findElement(locator); List<WebElement> elementList = new ArrayList<>(); elementList.add(element); wait.until(ExpectedConditions.visibilityOfAllElements(elementList)); check = false; } catch (Throwable e) { logger.info("Waiting for select element {} to be visible", locator); } } Select select = new Select(element); select.selectByValue(value); return element; }
From source file:org.eclipse.che.selenium.pageobject.CreateFactoryWidget.java
License:Open Source License
/** wait opening the widget */ public void waitOpen() { new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC) .until(ExpectedConditions.visibilityOfAllElements(Arrays.asList(invokeFactoryBtn, configureFactoryBtn, createFactoryBtn, nameFactoryField, factoryField, closeBtnID))); }
From source file:org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.java
License:Open Source License
/** @return Stack trace displayed in the right test result panel. */ public String getTestErrorMessage() { return new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC) .until(ExpectedConditions.visibilityOfAllElements(testOutput)).stream().map(WebElement::getText) .collect(Collectors.joining()); }
From source file:org.eclipse.che.selenium.pageobject.plugins.JavaTestRunnerPluginConsole.java
License:Open Source License
private List<String> getAllMetodsWithDefinedStatus(List<WebElement> definedMethod) { return new WebDriverWait(seleniumWebDriver, MINIMUM_SEC) .until(ExpectedConditions.visibilityOfAllElements(definedMethod)).stream().map(WebElement::getText) .collect(Collectors.toList()); }
From source file:org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils.java
License:Open Source License
public static List<WebElement> waitForElementsListVisibility(By by) { WebDriverWait wait = new WebDriverWait(driver, 3 * 60); return wait.until(ExpectedConditions.visibilityOfAllElements(driver.findElements(by))); }