Package org.openqa.selenium.support.ui

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


      WebElement name = driver.findElement(By.id("name"));
      name.sendKeys(userName);
      driver.findElement(By.id("start")).click();

      // Wait user to be joined
      (new WebDriverWait(driver, TIMEOUT))
          .until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
              return d.findElement(By.id("console")).getText()
                  .contains(userName + " has joined");
            }
          });

      // Wait button to connect user
      (new WebDriverWait(driver, TIMEOUT))
          .until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
              return d.findElement(By.linkText(userName))
                  .getText().contains(userName);
            }
View Full Code Here


    // Specific case: send commands
    if (expectedHandlerFlow != null
        && Arrays.asList(expectedHandlerFlow).contains(
            HANDLER_ON_CONTENT_COMMAND)) {
      // Wait the video to be started (TIMEOUT seconds at the most)
      (new WebDriverWait(driver, timeout))
          .until(new ExpectedCondition<Boolean>() {
            @Override
            public Boolean apply(WebDriver d) {
              return d.findElement(By.id("status"))
                  .getAttribute("value").startsWith("play");
            }
          });
      driver.findElement(By.id("sendCommands")).click();
    }

    // Wait test result, watching field "status" (TIMEOUT seconds at the
    // most)
    try {
      (new WebDriverWait(driver, timeout))
          .until(new ExpectedCondition<Boolean>() {
            @Override
            public Boolean apply(WebDriver d) {
              return d.findElement(By.id("status"))
                  .getAttribute("value").startsWith("end");
View Full Code Here

    Thread t = new Thread() {
      public void run() {
        ((JavascriptExecutor) driver)
            .executeScript("video.addEventListener('" + eventType
                + "', videoEvent, false);");
        (new WebDriverWait(driver, timeout))
            .until(new ExpectedCondition<Boolean>() {
              public Boolean apply(WebDriver d) {
                return d.findElement(By.id("status"))
                    .getAttribute("value")
                    .equalsIgnoreCase(eventType);
View Full Code Here

    return currentTime;
  }

  public boolean color(Color expectedColor, final double seconds, int x, int y) {
    // Wait to be in the right time
    (new WebDriverWait(driver, timeout))
        .until(new ExpectedCondition<Boolean>() {
          public Boolean apply(WebDriver d) {
            double time = Double.parseDouble(d.findElement(
                By.id("currentTime")).getAttribute("value"));
            return time > seconds;
View Full Code Here

      }

      ((JavascriptExecutor) driver).executeScript(getSdpOffer);

      // Wait to valid sdpOffer
      (new WebDriverWait(driver, timeout))
          .until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
              return ((JavascriptExecutor) driver)
                  .executeScript("return sdpOffer;") != null;
            }
View Full Code Here

    }
    driver.findElement(By.id("start")).click();

    // Wait test result, watching field "status" (TIMEOUT seconds at the
    // most)
    (new WebDriverWait(driver, TIMEOUT))
        .until(new ExpectedCondition<Boolean>() {
          public Boolean apply(WebDriver d) {
            return d.findElement(By.id("status"))
                .getAttribute("value").endsWith(status);
View Full Code Here

    return junitReport.toString();
  }

  private void waitForRunnerToFinish(final WebDriver driver, int timeout, boolean debug, Log log) throws InterruptedException {
    final JavascriptExecutor executor = (JavascriptExecutor) driver;
    new WebDriverWait(driver, timeout, 1000).until(new Predicate<WebDriver>() {
      @Override
      public boolean apply(WebDriver input) {
        return SpecRunnerExecutor.this.executionFinished(executor);
      }
    });
View Full Code Here

      public Boolean apply(WebDriver driver) {
        WebElement notification = driver.findElements(By.id("notification")).get(0);
        return notification.getText().equals("Configuration Saved");
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(isSaved);
  }
View Full Code Here

      public Boolean apply(WebDriver driver) {
        WebElement notification = driver.findElements(By.id("notification")).get(0);
        return notification.getText().equals("Configuration Deleted");
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(isDeleted);
  }
View Full Code Here

        WebElement running = (WebElement) ((JavascriptExecutor)driver).executeScript(
            "return $(\"li:contains('Crawl Execution Queue')\").parent().find(\"li:contains('running')\")[0];");
        return running != null;
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(isRunning);

    ExpectedCondition<Boolean> isComplete = new ExpectedCondition<Boolean>() {
      public Boolean apply(WebDriver driver) {
        WebElement success = (WebElement) ((JavascriptExecutor)driver).executeScript(
            "return $(\"li:contains('Crawl Execution Queue')\").parent().find(\"li > span:contains('" + CONFIG_NAME + "')\").parent().find(\"i:contains('success')\")[0];");
        return success != null;
      }
    };
    wait = new WebDriverWait(driver, 60);
    wait.until(isComplete);

    List<WebElement> crawlHistoryLink = driver.findElements(By.linkText("Crawl History"));
    followLink(crawlHistoryLink.get(0));

    WebElement crawlLink = (WebElement) ((JavascriptExecutor)driver).executeScript(
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.