Package org.openqa.selenium.support.ui

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


      //Because implicitlyWait time also set "driver.findElement()" wait time. 
      //info from: https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/6VO_7IXylgY
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
       
      WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
      element = wait.until(ExpectedConditions.visibilityOfElementLocated(by));
     
      driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_4_PAGE, TimeUnit.SECONDS); //reset implicitlyWait
      return element; //return the element 
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    WebElement element;
    try{
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
     
      WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
      element = wait.until(ExpectedConditions.presenceOfElementLocated(by));
     
      driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_4_PAGE, TimeUnit.SECONDS); //reset implicitlyWait
      return element; //return the element
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    List<WebElement> elements;
    try
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
       
      WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
      wait.until((new ExpectedCondition<Boolean>() {
              @Override
              public Boolean apply(WebDriver driverObject) {
                  return areElementsPresent(driverObject, by);
              }
          }));
View Full Code Here

        waitUntilPortletIsLoaded();
    }

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

    private boolean isLoggedIn() {
        return driver.findElements(By.linkText("Log Out")).size() == 1;
View Full Code Here

  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");
View Full Code Here

    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();
View Full Code Here

    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

    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"));
  }

  @After
View Full Code Here

    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"));
  }

  @After
  public void after() {
//    testUtil.deleteUser("admin");
View Full Code Here

  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");
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.