Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.WebDriverWait


   public static void waitForConsoleContainsText(WebDriver driver,
                                                 final String text) {
      final WebElement output = driver.findElement(By.id(
            ElementIds.getElementId(ElementIds.CONSOLE_OUTPUT)));

      (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() {
         public Boolean apply(WebDriver d) {
            String outputText = output.getText();
            return outputText.contains(text);
         }
      });
View Full Code Here


                                        String level2) {
      WebElement menuBar = driver.findElement(By.className("gwt-MenuBar"));
      WebElement menu1 = findMenuItemByName(menuBar, level1);
      menu1.click();
     
      WebElement menu1Popup = (new WebDriverWait(driver, 1))
            .until(ExpectedConditions.presenceOfElementLocated(
                  By.className("gwt-MenuBarPopup")));

      return findMenuItemByName(menu1Popup, level2);
   }
View Full Code Here

      WebElement popupItem = getMenuItem(driver, level1, level2);
      Actions action = new Actions(driver);
      action.moveToElement(popupItem).build().perform();
     
      // Wait for there to be two popups open (the level1 and level2 menus)
      (new WebDriverWait(driver, 1)).until(new ExpectedCondition<Boolean>() {
         public Boolean apply(WebDriver d) {
            List<WebElement>elements = driver.findElements(
                  By.className("gwt-MenuBarPopup"));
            return elements.size() > 1;
         }
View Full Code Here

{
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
      driver_ = RStudioWebAppDriver.start();

      (new WebDriverWait(driver_, 10))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.className("gwt-MenuBar")));
   }
View Full Code Here

    List<WebElement> found = getDriver().findElements(By.xpath(xpath));
    if (found == null || found.size() == 0 || found.size() > 1) {
      return false;
    }
    found.get(0).click();
    WebDriverWait webDriverWait = new WebDriverWait(getDriver(), 1);
    webDriverWait.until(new Exp.RepoListViewLoaded());
    return true;
  }
View Full Code Here

    List<WebElement> found = getDriver().findElements(By.xpath(pathToLink));
    if (found == null || found.size() == 0 || found.size() > 1) {
      return false;
    }
    found.get(0).click();
    WebDriverWait webDriverWait = new WebDriverWait(getDriver(),
        waitSecToLoad);
    webDriverWait.until(new Exp.EditRepoViewLoaded());
    return true;
  }
View Full Code Here

  }

  public boolean navigateToEditRepo(String fullyQualifiedRepoName,
      int waitSecToLoad) {
    boolean result = checkOrDoEditRepo(fullyQualifiedRepoName, true);
    WebDriverWait webDriverWait = new WebDriverWait(getDriver(),
        waitSecToLoad);
    webDriverWait.until(new Exp.EditRepoViewLoaded());
    return result;
  }
View Full Code Here

  public static final String WICKET_PAGES_PACKAGE_NAME = "com.gitblit.wicket.pages";
  public static final String WICKET_HREF_PAGE_PATH = "wicket:bookmarkablePage=:"
      + WICKET_PAGES_PACKAGE_NAME;

  synchronized public void waitToLoadFor(int sec) {
    WebDriverWait webDriverWait = new WebDriverWait(getDriver(), sec);
    webDriverWait.until(new ExpectedCondition<Boolean>() {
      public Boolean apply(WebDriver d) {
        return d.getTitle().toLowerCase()
            .startsWith(GitblitDashboardView.TITLE_STARTS_WITH);
      }
    });
View Full Code Here

    driver.navigate().to(pages.oex);

    try {
      // The dummy extension sets a HTML attribute on the <html> element.
      By by = By.cssSelector("html[isoexinstalled759='yes']");
      (new WebDriverWait(driver, 2)).until(ExpectedConditions.presenceOfElementLocated(by));
    } catch (TimeoutException e) {
      fail("Custom opera extension not detected!");
    }

    driver.quit();
View Full Code Here

  public void httpRedirect() {
    final String fetchedUrl = server.whereIs("redirect");
    driver.navigate().to(fetchedUrl);

    // Wait for redirect
    Wait<WebDriver> wait = new WebDriverWait(driver, OperaIntervals.PAGE_LOAD_TIMEOUT.getMs());
    wait.until(new ExpectedCondition<Object>() {
      public Boolean apply(WebDriver driver) {
        return !driver.getCurrentUrl().equals(fetchedUrl);
      }
    });
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.WebDriverWait

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.