Java 类org.openqa.selenium.support.pagefactory.DefaultElementLocator 实例源码

项目:bobcat    文件:ScopedElementLocator.java   
/**
 * Constructs a scope out of the scope factory and the parent field, then searches for the injected field
 * in this scope.
 */
@Override
public List<WebElement> findElements() {
  return scopeFactory.createLocator(scopeField).findElements().stream()
      .flatMap(element -> new DefaultElementLocator(element, searchField).findElements().stream())
      .collect(toList());
}
项目:bobcat    文件:WebElementScopedLocatorFactory.java   
/**
 * Return a DefaultElementLocator.
 */
@Override
public ElementLocator createLocator(Field field) {
  return new DefaultElementLocator(resolveContext(field), field);
}
项目:bobcat    文件:SelectorScopedElementLocator.java   
@Override
public WebElement findElement() {
  SearchContext context = getContext();
  return new DefaultElementLocator(context, field).findElement();
}
项目:bobcat    文件:SelectorScopedElementLocator.java   
@Override
public List<WebElement> findElements() {
  return selector.findElements(searchContext).stream()
      .flatMap(webElement -> new DefaultElementLocator(webElement, field).findElements().stream())
      .collect(toList());
}
项目:bobcat    文件:NestedSelectorScopedLocatorFactory.java   
/**
 * Creates a locator for the given field.
 */
@Override
public ElementLocator createLocator(Field field) {
  return field.isAnnotationPresent(Global.class) ? new DefaultElementLocator(searchContext, field)
      : new SelectorScopedElementLocator(searchContext, selector, field);
}
项目:bobcat    文件:ScopedElementLocator.java   
/**
 * Constructs a scope out of the scope factory and the parent field, then searches for the injected field
 * in this scope.
 */
@Override
public WebElement findElement() {
  WebElement context = scopeFactory.createLocator(scopeField).findElement();
  return new DefaultElementLocator(context, searchField).findElement();
}
项目:bobcat    文件:ScopedElementLocatorFactory.java   
@Override
public ElementLocator createLocator(final Field field) {
  return field.isAnnotationPresent(Global.class) ?
      new DefaultElementLocator(webDriver, field) :
      new ScopedElementLocator(parentFactory, parentField, field);
}
项目:WebAuto    文件:PageElementLocator.java   
@Override
public ElementLocator createLocator(Field field) {
    return new DefaultElementLocator(context, field);
}