Package org.openqa.selenium

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


  public void testFindingByTagNameShouldNotIncludeParentElementIfSameTagType() {
    driver.get(pages.xhtmlTestPage);
    WebElement parent = driver.findElement(By.id("my_span"));

    Assert.assertEquals(2, parent.findElements(By.tagName("div")).size());
    Assert.assertEquals(2, parent.findElements(By.tagName("span")).size());
  }

  @Test
  public void testFindingByCssShouldNotIncludeParentElementIfSameTagType() {
    driver.get(pages.xhtmlTestPage);
View Full Code Here


  @Test
  public void testShouldBeAbleToFindChildrenOfANode() {
    driver.get(pages.selectableItemsPage);
    List<WebElement> elements = driver.findElements(By.xpath("/html/head"));
    WebElement head = elements.get(0);
    List<WebElement> importedScripts = head.findElements(By.tagName("script"));
    Assert.assertEquals(importedScripts.size(), 3);
  }

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

  @Test
  public void testShouldBeAbleToFindChildrenOfANode2() {
    driver.get(pages.selectableItemsPage);
    List<WebElement> elements = driver.findElements(By.cssSelector("html>head"));
    WebElement head = elements.get(0);
    List<WebElement> importedScripts = head.findElements(By.tagName("script"));
    Assert.assertEquals(importedScripts.size(), 3);
  }

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

  @Test
  public void testReturnAnEmptyListWhenThereAreNoChildrenOfANode() {
    driver.get(pages.xhtmlTestPage);
    WebElement table = driver.findElement(By.id("table"));
    List<WebElement> rows = table.findElements(By.tagName("tr"));

    Assert.assertEquals(rows.size(), 0);
  }

  @Test
View Full Code Here

    {
        List<String> names = newArrayList();
        WebElement row = getModuleRow(moduleId);
        if (row != null)
        {
            for (WebElement exportName : row.findElements(By.className("export-name")))
            {
                names.add(exportName.getText());
            }
        }
        return names;
View Full Code Here

        openTestURL();

        WebElement caption = driver.findElement(By.className("v-caption"));
        Assert.assertNotNull(caption);

        List<WebElement> elements = caption.findElements(By.xpath("*"));

        boolean foundCaptionText = false;
        for (WebElement element : elements) {
            if ("Popup Caption:".equals(element.getText())) {
                foundCaptionText = true;
View Full Code Here

    return -1;
  }

  public int studentCountTotalCourses() {
    WebElement dataform = driver.findElement(By.id("dataform"));
    return dataform.findElements(By.tagName("tr")).size();
  }

  // Pending Evaluation
  public By studentGetPendingEvaluationName(String courseId, String evalName) throws NullPointerException {
    int row = this.studentFindPendingEvaluationRow(courseId, evalName);
View Full Code Here

    cout("delete all students");
    driver.findElement(By.className("t_courses")).click();
    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);
      clickAndConfirm(by);
      waitForElementPresent(By.id("dataform tr"));
View Full Code Here

    // Verify Second Evaluation
    bi.clickEvaluationViewResults(scn.course.courseId, scn.evaluation2.name);
    bi.waitForElementPresent(bi.resultDetailRadio);

    WebElement htmldiv = bi.getDriver().findElement(By.id("coordinatorEvaluationSummaryTable"));
    assertEquals(5, htmldiv.findElements(By.tagName("tr")).size());
  }

  //TODO: drop team before evaluation close

  // drop team after evaluation close
View Full Code Here

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

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

    waitAWhile(5000);
    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

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.