Examples of WebDriverWait


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

    @Test
    public void testWidthAndHeightRanges() throws Exception {
        openTestURL();

        // IE sometimes has trouble waiting long enough.
        new WebDriverWait(getDriver(), 30).until(ExpectedConditions
                .presenceOfElementLocated(By
                        .cssSelector(".v-csslayout-width-and-height")));

        // Verify both width-range and height-range.
        assertEquals("600px-",
View Full Code Here

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

     * @param condition
     *            the condition to wait for to become true
     */
    protected <T> void waitUntil(ExpectedCondition<T> condition,
            long timeoutInSeconds) {
        new WebDriverWait(driver, timeoutInSeconds).until(condition);
    }
View Full Code Here

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

    public void scriptsShouldPreloadAndExecuteInCorrectOrder()
            throws InterruptedException {
        openTestURL();

        try {
            new WebDriverWait(driver, 10).until(ExpectedConditions
                    .alertIsPresent());
            Alert alert = driver.switchTo().alert();
            assertEquals("First", alert.getText());
            alert.accept();

            new WebDriverWait(driver, 10).until(ExpectedConditions
                    .alertIsPresent());
            alert = driver.switchTo().alert();
            assertEquals("Second", alert.getText());
            alert.accept();
View Full Code Here

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

        waitUntilPortletIsLoaded();
    }

    private void waitUntilPortletIsLoaded() {
        WebDriverWait wait = new WebDriverWait(driver, 15);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By
                .className("v-app")));
    }
View Full Code Here

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

  @Test
  public void testLogin() {
    driver.get(appUrl+"/#/login");

    WebDriverWait wait = new WebDriverWait(driver, 10);

    WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]")));
    user.sendKeys("demo");

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
    submit.submit();

    WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("a.tile")));
    element.click();
    Boolean found = wait.until(ExpectedConditions.textToBePresentInElement(By.tagName("h1"), "Invoice Receipt"));
  }
View Full Code Here

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

  @Test
  public void testLogin() {
    driver.get(appUrl + "/#/login");

    WebDriverWait wait = new WebDriverWait(driver, 10);

    WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]")));
    user.sendKeys("demo");

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
    submit.submit();

//    String xpathExpression = "//td[contains(text(),'Assign Approver')]";
//    WebElement found = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(xpathExpression)));
//    assertNotNull(found);
View Full Code Here

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

   * @see #waitForTextPresent(By, String, int)
   * @see ExpectedConditions
   */
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void waitForCondition(ExpectedCondition conditon, int timeout) {
    (new WebDriverWait(driver, timeout)).until(conditon);
  }
View Full Code Here

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

    /**
     * Wait the specified interval for a json list with the specified number of entries
     */
    public WebElement waitForJsonList(final int count, final JsonValidator jsonValidator, final int secs) {
        try {
            return (new WebDriverWait(environment.getWebDriver(), secs)).until(new ExpectedCondition<WebElement>() {
                @Override
                public WebElement apply(WebDriver webDriver) {
                    WebElement element = webDriver.findElement(By.id("json"));
                    String text = element.getText();
                    if (StringUtil.isNotEmpty(text)) {
View Full Code Here

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

      WebElement submitEl = loginForm.findElements(By.id(submitId))
          .get(0);
      usernameEl.sendKeys(username);
      if (continueButton!=null) {
        continueButton.click();
        WebDriverWait wait = new WebDriverWait(webDriver, 10);
        WebElement element = wait.until(
                ExpectedConditions.visibilityOfElementLocated(By.id(submitId)));
      }
      passwordEl.sendKeys(password);
      submitEl.click();
    } else {
View Full Code Here

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

   * Wait the specified interval for any popup with the specified titles to
   * appear
   */
  public WebElement waitForPopups(final int secs, final String[] titles) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .until(new ExpectedCondition<WebElement>() {
            @Override
            public WebElement apply(WebDriver webDriver) {
              failIfPageCrashed(webDriver);
              WebDriver popup = findPopup(titles);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.