Package org.openqa.selenium

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


            return resultEl.findElement(By.name("_shareFilePropagate"));
        }
             
        public WebElement getUploadBtn() {
            WebElement resultEl = getWidgetDiv();
            return resultEl.findElements(By.tagName("button")).get(0);
        }
     
        public WebElement getCancelBtn() {
            WebElement resultEl = getWidgetDiv();
            return resultEl.findElements(By.tagName("button")).get(1);
View Full Code Here


            return resultEl.findElements(By.tagName("button")).get(0);
        }
     
        public WebElement getCancelBtn() {
            WebElement resultEl = getWidgetDiv();
            return resultEl.findElements(By.tagName("button")).get(1);
        }
       
        public void setFile(String file) {
            WebElement fileInput = getFileInput();
            fileInput.sendKeys(file);
View Full Code Here

            return resultEl.findElement(By.name("tags"));
        }
     
        public WebElement getAddTagsBtn() {
            WebElement resultEl = getWidgetDiv();
            return resultEl.findElements(By.tagName("button")).get(0);
        }
     
        public WebElement getCancelBtn() {
            WebElement resultEl = getWidgetDiv();
            return resultEl.findElements(By.tagName("button")).get(1);
View Full Code Here

            return resultEl.findElements(By.tagName("button")).get(0);
        }
     
        public WebElement getCancelBtn() {
            WebElement resultEl = getWidgetDiv();
            return resultEl.findElements(By.tagName("button")).get(1);
        }
       
        public void setTags(String tags) {
            WebElement tagsInput = getTagsInput();
            tagsInput.clear();
View Full Code Here

                return null;
              } else if (condition
                  .equalsIgnoreCase("idWithChild")) {
                WebElement element = webDriver.findElement(By
                    .id(match));
                List<WebElement> children = element
                    .findElements(By.xpath("*"));
                if (!children.isEmpty()) {
                  return element;
                }
                return null;
View Full Code Here

     */
    private boolean checkCodeDivs(SampleFrameworkResultPage resultPage) {
        WebElement jspDiv = resultPage.getJspSnippetDiv();
        String jspContent = jspDiv.getAttribute("innerHTML");
        WebElement ulNav = resultPage.getCodeNav();
        List<WebElement> tabList = ulNav.findElements(By.xpath(".//a"));
        WebDriverWait wait = new WebDriverWait(resultPage.getWebDriver(), 2);
        tabList.get(1).click();
        boolean docDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.DOCSNIPPETDIV))).isDisplayed();

        return jspContent != null && docDivDisplayed;
View Full Code Here

     */
    private boolean checkCodeDivs(SampleFrameworkResultPage resultPage) {
        WebElement jsDiv = resultPage.getJsSnippetDiv();
        String jsContent = jsDiv.getAttribute("innerHTML");
        WebElement ulNav = resultPage.getCodeNav();
        List<WebElement> tabList = ulNav.findElements(By.xpath(".//a"));
        WebDriverWait wait = new WebDriverWait(resultPage.getWebDriver(), 5l);
        tabList.get(1).click();
        boolean htmlDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.HTMLSNIPPETDIV))).isDisplayed();
        tabList.get(2).click();
        boolean cssDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.CSSSNIPPETDIV))).isDisplayed();
View Full Code Here

     *
     * @return
     */
    public List<WebElement> getTableRows() {
        WebElement resultEl = getWebElement();
        return resultEl.findElements(By.tagName("tr"));
    }
   
    /**
     * Return a WebElement for the pager div that was created on this page
     *
 
View Full Code Here

     *
     * @return
     */
    public List<WebElement> getListItems() {
        WebElement resultEl = getWebElement();
        return resultEl.findElements(By.tagName("li"));
    }
     
}
View Full Code Here

  @Test
  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() {
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.