Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.WebDriverWait.until()


        waitForElementPresent("Button element never appeared with JS helper", button);
        assertEquals("Something wrong with test initialization.", "Button", button.getText());
        button.click();
        WebDriverWait wait = new WebDriverWait(getDriver(), 5);
        assertTrue("JS controller or Java controller failed to workin PROD mode.",
                wait.until(new ExpectedCondition<Boolean>() {
                    @Override
                    public Boolean apply(WebDriver d) {
                        return ("TestController".equals(button.getText()));
                    }
                }));
View Full Code Here


        findDomElement(By.cssSelector(".trigger")).click();

        // Wait till prior prior client-side change is gone indicating page
        // reload
        WebDriverWait wait = new WebDriverWait(getDriver(), 30);
        wait.until(new ExpectedCondition<Boolean>() {
            @Override
            public Boolean apply(WebDriver d) {
                return !auraUITestingUtil.getBooleanEval("return !!document.__PageModifiedTestFlag");
            }
        });
View Full Code Here

    public WebElement waitForElement(String msg, By locator) {
        WaitAndRetrieve war = new WaitAndRetrieve(locator);
        WebDriverWait wait = new WebDriverWait(driver, timeoutInSecs);
        wait.withMessage(msg);
        wait.ignoring(NoSuchElementException.class);
        wait.until(war);
        return war.getFound();
    }

    /**
     * Waits for element with matching locator to appear in dom.
View Full Code Here

     * Wait the specified number of seconds until the provided Function returns true or non-null. Any uncaught
     * javascript errors will trigger an AssertionFailedError.
     */
    public <V> V waitUntil(Function<? super WebDriver, V> function, long timeoutInSecs) {
        WebDriverWait wait = new WebDriverWait(driver, timeoutInSecs);
        return wait.until(addErrorCheck(function));
    }

    /**
     * Wait until the provided Function returns true or non-null. If this does not occur, error out with passed in
     * message. Any uncaught javascript errors will trigger an AssertionFailedError.
View Full Code Here

        screenSnapper.createSnapAndThumbnail(searchbox);

        searchbox.sendKeys("cheese");

        WebElement searchButton = wait.until(visibilityOfElementLocated(By.name("btnG")));

        searchButton.click();

        wait.until(visibilityOfElementLocated(By.className("navend")));
View Full Code Here

        WebElement searchButton = wait.until(visibilityOfElementLocated(By.name("btnG")));

        searchButton.click();

        wait.until(visibilityOfElementLocated(By.className("navend")));

        List<WebElement> results = driver.findElements(By.className("g"));

        screenSnapper.createSnapAndThumbnail(results);
View Full Code Here

            }
        };
        @SuppressWarnings("rawtypes")
        //wait 20 seconds for tests to pass...
    Wait w = new WebDriverWait(driver, 20);
        w.until(e);

        WebElement error   = driver.findElement(By.className("status-error"));
        WebElement failure = driver.findElement(By.className("status-failure"));
        WebElement success = driver.findElement(By.className("status-success"));
View Full Code Here

  @Test @RunAsClient
  public void test() throws Exception {
    driver.get(applicationURL().toString());
    WebDriverWait wait = new WebDriverWait(driver, 5);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html[@foo]")));
    WebElement elt = driver.findElement(By.tagName("html"));
    assertEquals("foo_value", elt.getAttribute("foo"));
  }
}
View Full Code Here

  @Test @RunAsClient
  public void test() throws Exception {
    driver.get(applicationURL().toString());
    WebDriverWait wait = new WebDriverWait(driver, 5);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html[@bar]")));
    WebElement elt = driver.findElement(By.tagName("html"));
    assertEquals("<bar>foo_value</bar>", elt.getAttribute("bar"));
  }

  @Test
View Full Code Here

  @Test
  @RunAsClient
  public void test() throws Exception {
    driver.get(applicationURL().toString());
    WebDriverWait wait = new WebDriverWait(driver, 5);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html[@bar]")));
    WebElement elt = driver.findElement(By.tagName("html"));
    assertEquals("<bar>foo_value</bar>", elt.getAttribute("bar"));
  }
}
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.