Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement.findElements()


    waitAndClick(By.className("t_course_view"));
    waitForElementPresent(By.cssSelector("#dataform tr"));

    WebElement htmldiv = driver.findElement(By.id("coordinatorStudentTable"));

    assertEquals(5, htmldiv.findElements(By.tagName("tr")).size());

    waitAndClickAndConfirm((By.xpath(String.format(
        "//table[@id='dataform']//tr[%d]//a[3]", 2))));

    justWait();
View Full Code Here


    waitAndClickAndConfirm((By.xpath(String.format(
        "//table[@id='dataform']//tr[%d]//a[3]", 2))));

    justWait();
    assertEquals(4, htmldiv.findElements(By.tagName("tr")).size());

    // Verify Report
    waitAndClick(By.className("t_evaluations"));
    // Verify Coordinator View
    waitAndClick(By.id("viewEvaluation0"));
View Full Code Here

    waitAndClick(By.className("t_course_view"));
    waitForElementPresent(By.id("dataform tr"));

    WebElement dataform = driver.findElement(By.id("dataform"));

    while (dataform.findElements(By.tagName("tr")).size() > 1) {
      System.out.println("Delete a student...");

      By by = By.xpath(String
          .format("//table[@id='dataform']//tr[%d]//a[4]", 2));
      waitForElementPresent(by);
View Full Code Here

      System.out.println("Opening TR Page...");
      driver.get(TR_MAIN_PAGE);

      driver.findElement(By.className("selectBox-label")).click();
      WebElement dropdownMenu = driver.findElement(By.className("selectBox-dropdown-menu"));
      List<WebElement> sectionLis = dropdownMenu.findElements(By.tagName("li"));
      System.out.println("Section count: " + sectionLis.size());

      for (int i = 0; i < sectionLis.size(); i++) {
        // browse all pages
        List<WebElement> nextPageLinks = driver.findElements(By.className("next_page"));
View Full Code Here

                                           String response) {
      WebElement dialog = waitForModalToAppear(driver);
     
      // Find the button requested and invoke it
      List<WebElement> buttons =
            dialog.findElements(By.className("gwt-Button-DialogAction"));
      for (WebElement button: buttons) {
         if (button.getText().equals(response)) {
            button.click();
            break;
         }
View Full Code Here

  public void isVisibleTests() {

    WebElement navBar = driver.findElement(By.tagName("UIANavigationBar"));
    Assert.assertTrue(navBar.isDisplayed(), "nav bar");

    List<WebElement> imgs = navBar.findElements(By.className("UIAImage"));

    Assert.assertEquals(imgs.size(), 2, "number of images in the menu");

    for (WebElement el : imgs) {
      Assert.assertFalse(el.isDisplayed(), "image");
View Full Code Here

  public void canOnlyClickVisibleElement() {
    WebElement navBar = driver.findElement(By.tagName("UIANavigationBar"));
    Assert.assertTrue(navBar.isDisplayed(), "nav bar");
    navBar.click();

    List<WebElement> imgs = navBar.findElements(By.className("UIAImage"));

    Assert.assertEquals(imgs.size(), 2, "number of images in the menu");

    for (WebElement el : imgs) {
      Assert.assertFalse(el.isDisplayed(), "image");
View Full Code Here

  @Test
  public void testFindingElementsOnElementByXPathShouldFindTopLevelElements() {
    driver.get(pages.simpleTestPage);
    WebElement parent = driver.findElement(By.id("multiline"));
    List<WebElement> allPs = driver.findElements(By.xpath("//p"));
    List<WebElement> children = parent.findElements(By.xpath("//p"));
    Assert.assertEquals(allPs.size(), children.size());
  }

  @Test
  public void testFindingDotSlashElementsOnElementByXPathShouldFindNotTopLevelElements() {
View Full Code Here

  @Test
  public void testFindingDotSlashElementsOnElementByXPathShouldFindNotTopLevelElements() {
    driver.get(pages.simpleTestPage);
    WebElement parent = driver.findElement(By.id("multiline"));
    List<WebElement> children = parent.findElements(By.xpath("./p"));
    Assert.assertEquals(1, children.size());
    Assert.assertEquals("A div containing", children.get(0).getText());
  }

  @Test
View Full Code Here

  @Test
  public void testfindElementsByXPath() {
    driver.get(pages.nestedPage);
    WebElement element = driver.findElement(By.name("form2"));
    List<WebElement> children = element.findElements(By.xpath("select/option"));
    Assert.assertEquals(children.size(), (8));
    Assert.assertEquals(children.get(0).getText(), ("One"));
    Assert.assertEquals(children.get(1).getText(), ("Two"));
  }
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.