Package org.openqa.selenium.support.ui

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


  @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


  @RunAsClient
  public void test() throws Exception {
    driver.get(applicationURL().toString());
    System.out.println(driver.getPageSource());
    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

  @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[@foo]")));
    WebElement elt = driver.findElement(By.tagName("html"));
    assertEquals("foo_value", elt.getAttribute("foo"));
  }
}
View Full Code Here

    return path + JERSEY_FILE;
  }

  public void waitForElement(WebDriver browser, String xpath) {
    WebDriverWait wait = new WebDriverWait(browser, 10);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.ByXPath.xpath(xpath)));
  }

  public boolean isThere(WebDriver browser, String xpath) {
    boolean isThere = false;
    int count = 0;
View Full Code Here

        WebElement formElement = d.findElement(By.id("submitListeningForm"));
        formElement.submit();

        WebDriverWait wait = new WebDriverWait(d, 30);
        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("result"), "form-onsubmit"));

        WebElement result = d.findElement(By.id("result"));
        String text = result.getText();
        boolean conditionMet = text.contains("form-onsubmit");
View Full Code Here

        // This should cause a reload in the frame "classFrame"
        d.findElement(By.linkText("HttpClient")).click();

        // Wait for new content to load in the frame.
        WebDriverWait wait = new WebDriverWait(d, 10);
        wait.until(ExpectedConditions.titleContains("HttpClient"));

        // Frame should still be "classFrame"
        assertEquals("classFrame", getCurrentFrameName(d));

        // Check if a link "clearCookies()" is there where expected
View Full Code Here

        // This should cause a reload in the frame "classFrame"
        d.findElement(By.linkText("HttpClient")).click();

        // Wait for new content to load in the frame.
        WebDriverWait wait = new WebDriverWait(d, 10);
        wait.until(ExpectedConditions.titleContains("HttpClient"));

        // Frame should still be "classFrame"
        assertEquals("classFrame", getCurrentFrameName(d));

        // Check if a link "clearCookies()" is there where expected
View Full Code Here

        d.findElement(By.linkText("top")).click();

        // Wait for new content to load in the frame.
        expectedTitle = "XHTML Test Page";
        WebDriverWait wait = new WebDriverWait(d, 10);
        wait.until(ExpectedConditions.titleIs(expectedTitle));
        assertEquals(expectedTitle, d.getTitle());

        WebElement element = d.findElement(By.id("amazing"));
        assertNotNull(element);
    }
View Full Code Here

        d.findElement(By.id("go")).submit();

        // Uploading files across a network may take a while, even if they're really small.
        // Wait for the loading label to disappear.
        WebDriverWait wait = new WebDriverWait(d, 10);
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label")));

        d.switchTo().frame("upload_target");

        wait = new WebDriverWait(d, 5);
        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT));
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.