org.openqa.selenium.remote.RemoteWebDriver.findElements()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中org.openqa.selenium.remote.RemoteWebDriver.findElements方法的一些代码示例,展示了RemoteWebDriver.findElements的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteWebDriver.findElements方法的具体详情如下:
包路径:org.openqa.selenium.remote.RemoteWebDriver
类名称:RemoteWebDriver
方法名:findElements

RemoteWebDriver.findElements介绍

暂无

代码示例

代码示例来源:origin: appium/java-client

@Override public List findElements(String by, String using) {
  return super.findElements(by, using);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByTagName(String using) {
  if (getW3CStandardComplianceLevel() == 0) {
    return findElements("tag name", using);
  }
  return findElementsByCssSelector(using);
}

代码示例来源:origin: la-team/light-admin

@Override
public List<WebElement> findElements(final By by) {
  return webDriver.findElements(by);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByName(String using) {
  if (getW3CStandardComplianceLevel() == 0) {
    return findElements("name", using);
  }
  return findElementsByCssSelector("*[name='" + using + "']");
}

代码示例来源:origin: appium/java-client

@Override public List findElements(By by) {
  return super.findElements(by);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByClassName(String using) {
  if (getW3CStandardComplianceLevel() == 0) {
    return findElements("class name", using);
  }
  return findElementsByCssSelector("." + cssEscape(using));
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui

@Override
public List<WebElement> findElements(By by)
{
  return this.wrappedDriver.findElements(by);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsById(String using) {
  if (getW3CStandardComplianceLevel() == 0) {
    return findElements("id", using);
  }
  return findElementsByCssSelector("#" + cssEscape(using));
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByCssSelector(String using) {
  return findElements("css selector", using);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByXPath(String using) {
  return findElements("xpath", using);
}

代码示例来源:origin: org.mycore/selenium-utils

public List<WebElement> findElements(By by) {
  return delegate.findElements(by);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByLinkText(String using) {
  return findElements("link text", using);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public List<WebElement> findElementsByPartialLinkText(String using) {
  return findElements("partial link text", using);
}

代码示例来源:origin: org.eclipse.che.selenium/che-selenium-core

@Override
public List<WebElement> findElements(By by) {
 return driver.findElements(by);
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @Title: findElementsWithXPath @Description: TODO @author
 *         Judy.Zhu@greendotcorp.com @param @param
 *         params1 @param @return @return List<WebElement> return
 *         type @throws
 */
public List<WebElement> findElementsWithXPath(String params1) {
  // throw new PendingException();
  List<WebElement> findElements = driver.findElements(By.xpath(params1));
  return findElements;
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @Title: findElementsWithTagname @Description: TODO @author
 *         ahu@greendotcorp.com @param @param params1 @param @return @return
 *         List<WebElement> return type @throws
 */
public List<WebElement> findElementsWithTagname(String params1) {
  // throw new PendingException();
  List<WebElement> findElements = driver.findElements(By.tagName(params1));
  return findElements;
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @param params1
 * @return List<WebElement>
 */
public List<WebElement> findElementsWithLinkText(String params1) {
  List<WebElement> findElements = driver.findElements(By.linkText(params1));
  return findElements;
}

代码示例来源:origin: com.watchrabbit/crawler-executor

private List<String> collectLinks(RemoteWebDriver driver) {
  return driver.findElements(By.xpath("//a")).stream()
      .filter(element -> element.isDisplayed())
      .map(link -> link.getAttribute("href"))
      .filter(link -> link != null)
      .filter(link -> link.startsWith("http"))
      .distinct()
      .collect(toList());
}

代码示例来源:origin: com.watchrabbit/crawler-auth

private WebElement locateLoginForm(RemoteWebDriver driver) {
  for (WebElement form : driver.findElements(By.xpath("//form"))) {
    LOGGER.debug("Looking to form with action {}", form.getAttribute("action"));
    List<WebElement> inputs = form.findElements(By.xpath(".//input")).stream()
        .filter(input -> isLoginInput(input) || isPasswordInput(input))
        .filter(input -> input.isDisplayed())
        .collect(toList());
    if (inputs.size() == 2) {
      return form;
    }
  }
  return null;
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @Title: switchToIframe @Description: TODO @author
 *         Judy.Zhu@greendotcorp.com @param @return void return type @throws
 */
public void switchToIframe(int iframeSequence) {
  driver.switchTo().frame(driver.findElements(By.tagName("iframe")).get(iframeSequence));
}

相关文章