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

x33g5p2x  于2022-01-16 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(206)

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

By.findElements介绍

[英]Find many elements.
[中]找到许多元素。

代码示例

代码示例来源:origin: com.machinepublishers/jbrowserdriver

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

代码示例来源:origin: org.openqa.selenium.webdriver/webdriver-common

/**
 * Find many elements.
 *
 * @param driver A driver to use to find the element
 * @return A list of WebElements matching the selector
 * @deprecated use findElements(SearchContext) instead
 */
public List<WebElement> findElements(WebDriver driver) {
  return findElements((SearchContext) driver);
}

代码示例来源:origin: org.jboss.arquillian.graphene/graphene-webdriver-api

@Override
public List<WebElement> findElements(SearchContext context) {
  return implementation.findElements(context);
}

代码示例来源:origin: org.jboss.arquillian.extension/arquillian-angularjs-graphene-api

@Override
public List<WebElement> findElements(SearchContext context) {
  return implementation.findElements(context);
}

代码示例来源:origin: com.machinepublishers/jbrowserdriver

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

代码示例来源:origin: org.finra.jtaf/jtaf-extwebdriver

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

代码示例来源:origin: com.machinepublishers/jbrowserdriver

/**
 * {@inheritDoc}
 */
@Override
public List findElements(By by) {
 return by.findElements(this);
}

代码示例来源:origin: org.seleniumhq.selenium/selenium-android-driver

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

代码示例来源:origin: org.seleniumhq.selenium/selenium-android-driver

public List<WebElement> findElements(By by) {
 long start = System.currentTimeMillis();
 List<WebElement> found = by.findElements(findBy);
 while (found.isEmpty() && (System.currentTimeMillis() - start <= implicitWait)) {
  sleepQuietly(100);
  found = by.findElements(this);
 }
 return found;
}

代码示例来源:origin: org.seleniumhq.webdriver/webdriver-support

@Override
public List<WebElement> findElements(SearchContext finder) {
 List<WebElement> elements = new ArrayList<WebElement>();
 // First: Find by id ...
 elements.addAll(idFinder.findElements(finder));
 // Second: Find by name ...
 elements.addAll(nameFinder.findElements(finder));
 return elements;
}

代码示例来源:origin: org.openqa.selenium.webdriver/webdriver-support

@Override
public List<WebElement> findElements(SearchContext finder) {
 List<WebElement> elements = new ArrayList<WebElement>();
 // First: Find by id ...
 elements.addAll(idFinder.findElements(finder));
 // Second: Find by name ...
 elements.addAll(nameFinder.findElements(finder));
 return elements;
}

代码示例来源:origin: org.seleniumhq.selenium/selenium-htmlunit-driver

List<WebElement> findElements(final By by, final SearchContext context) {
 long end = System.currentTimeMillis() + implicitWait;
 List<WebElement> found;
 do {
  found = by.findElements(context);
  if (!found.isEmpty()) {
   return found;
  }
 } while (System.currentTimeMillis() < end);
 return found;
}

代码示例来源:origin: org.seleniumhq.selenium/selenium-android-driver

public List<WebElement> findElements(By by) {
 long start = System.currentTimeMillis();
 List<WebElement> found = by.findElements(findBy);
 while (found.isEmpty() && (System.currentTimeMillis() - start <= implicitWait)) {
  sleepQuietly(100);
  found = by.findElements(findBy);
 }
 return found;
}

代码示例来源:origin: seleniumQuery/seleniumQuery

private boolean testPseudoClassNativeSupport(String pseudo, SearchContext context) {
  try {
    By.cssSelector("#AAA_SomeIdThatShouldNotExist"+pseudo).findElements(context);
    return true;
  } catch (Exception ignored) {
    return false;
  }
}

代码示例来源:origin: seleniumQuery/seleniumQuery

private boolean testPseudoClassNativeSupport(String pseudo, SearchContext context) {
  try {
    By.cssSelector("#AAA_SomeIdThatShouldNotExist"+pseudo).findElements(context);
    return true;
  } catch (Exception ignored) {
    return false;
  }
}

代码示例来源:origin: org.seleniumhq.selenium.fluent/fluent-selenium

@Override
public List<WebElement> findElements(SearchContext context) {
  return makeByXPath().findElements(context);
}

代码示例来源:origin: org.seleniumhq.selenium.fluent/fluent-selenium

@Override
public List<WebElement> findElements(SearchContext context) {
  return makeXPath().findElements(context);
}

代码示例来源:origin: org.openqa.selenium.webdriver/webdriver-common

/**
 * Find a single element. Override this method if necessary.
 * @param context A context to use to find the element
 * @return The WebElement that matches the selector
 */
public WebElement findElement(SearchContext context) {
  List<WebElement> allElements = findElements(context);
  if (allElements == null || allElements.size() == 0)
    throw new NoSuchElementException("Cannot locate an element using " + toString());
  return allElements.get(0);
}

代码示例来源:origin: Cognifide/bobcat

@Override
public List<WebElement> findElements() {
 return selector.findElements(searchContext).stream()
   .flatMap(webElement -> new DefaultElementLocator(webElement, field).findElements().stream())
   .collect(toList());
}

代码示例来源:origin: com.cognifide.qa.bb/bb-core

@Override
public List<WebElement> findElements() {
 return selector.findElements(searchContext).stream()
   .flatMap(webElement -> new DefaultElementLocator(webElement, field).findElements().stream())
   .collect(toList());
}

相关文章