コード例 #1
0
  @Override
  public List<WebElementFacade> thenFindAll(String xpathOrCssSelector) {
    logIfVerbose("findAll " + xpathOrCssSelector);
    List<WebElement> nestedElements;
    if (isXPath(xpathOrCssSelector)) {
      nestedElements = findElements((By.xpath(xpathOrCssSelector)));
    } else {
      nestedElements = findElements((By.cssSelector(xpathOrCssSelector)));
    }

    return webElementFacadesFrom(nestedElements);
  }
コード例 #2
0
 @Override
 public List<String> getSelectOptions() {
   List<WebElement> results = Collections.emptyList();
   if (getElement() != null) {
     results = findElements(By.tagName("option"));
   }
   return convert(results, new ExtractText());
 }
コード例 #3
0
  @Override
  public <T extends WebElementFacade> T findBy(String xpathOrCssSelector) {
    logIfVerbose("findBy " + xpathOrCssSelector);
    WebElement nestedElement;
    if (isXPath(xpathOrCssSelector)) {
      nestedElement = getElement().findElement((By.xpath(xpathOrCssSelector)));
    } else {
      nestedElement = getElement().findElement((By.cssSelector(xpathOrCssSelector)));
    }

    return wrapWebElement(
        driver,
        nestedElement,
        timeoutInMilliseconds(),
        waitForTimeoutInMilliseconds,
        "element located by " + xpathOrCssSelector);
  }
コード例 #4
0
 @Override
 public WebElementFacade findBy(By selector) {
   logIfVerbose("findBy " + selector);
   WebElement nestedElement = getElement().findElement(selector);
   return wrapWebElement(
       driver,
       nestedElement,
       timeoutInMilliseconds(),
       waitForTimeoutInMilliseconds,
       "element located by " + selector.toString());
 }