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

项目:bobcat    文件:PageObjectInjector.java   
/**
 * This method creates the object of type clazz within context defined by the top web element and the
 * frame path provided as the parameter.
 *
 * @param clazz     PageObject class.
 * @param framePath instance of FramePath.
 * @param <T>       type of PageObject class that will be returned.
 * @return instance of Injector.
 */
public <T> T inject(Class<T> clazz, FramePath framePath) {
  final ElementLocatorFactory elementLocatorFactory = new DefaultElementLocatorFactory(webDriver);
  stack.push(new PageObjectContext(elementLocatorFactory, framePath));
  try {
    return injector.getInstance(clazz);
  } finally {
    stack.pop();
  }
}
项目:UIFramework    文件:HighCharts.java   
public HighCharts(WebDriver driver, WebElement chart) {
    PageFactory.initElements(new DefaultElementLocatorFactory(chart), this);
    this.driver = driver;
    this.chart = chart;

    int waitTimeoutInSeconds = 15;
    wait = new WebDriverWait(driver, waitTimeoutInSeconds, 100);
    performAction = new Actions(driver);
}
项目:wiselenium    文件:WisePageFactory.java   
private static FieldDecorator initDecorator(SearchContext searchContext, Field field) {
    FieldDecorator decorator;
    AjaxElement ajaxElementAnnotation = field.getAnnotation(AjaxElement.class);
    if (ajaxElementAnnotation != null) {
        int timeout = ajaxElementAnnotation.timeOutInSeconds();
        decorator = new WiseDecorator(new AjaxElementLocatorFactory(searchContext, timeout));
    } else {
        decorator = new WiseDecorator(new DefaultElementLocatorFactory(searchContext));
    }
    return decorator;
}
项目:spring-reactive-sample    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-reactive-sample    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-reactive-sample    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-reactive-sample    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-reactive-sample    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-reactive-sample    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:selenide-appium    文件:SelenideAppiumFieldDecorator.java   
public SelenideAppiumFieldDecorator(SearchContext context) {
  super(context);
  this.searchContext = context;
  this.factory = new DefaultElementLocatorFactory(searchContext);
}
项目:bobcat    文件:ContextStack.java   
private PageObjectContext getDefaultPageObjectContext(WebDriver webDriver) {
  ElementLocatorFactory elementLocatorFactory = new DefaultElementLocatorFactory(webDriver);
  FramePath framePath = new FramePath();
  return new PageObjectContext(elementLocatorFactory, framePath);
}
项目:SwiftLite    文件:HighCharts.java   
public HighCharts(WebDriver driver, WebElement chart) {
    PageFactory.initElements(new DefaultElementLocatorFactory(chart), this);
    this.driver = driver;
    this.chart = chart;

}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:LoginPage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:LoginPage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:LoginPage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:LoginPage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:LoginPage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Form(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:spring-session    文件:HomePage.java   
public Attribute(SearchContext context) {
    PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
项目:fuwesta    文件:BasePage.java   
/**
 * Recreate the page after a reload, this is important if the weblements are
 * cached.
 */
public final void isReloaded() {
    PageFactory.initElements(new ElementDecorator(webDriver,
            new DefaultElementLocatorFactory(webDriver), pageName, ""),
            this);
}
项目:wiselenium    文件:Wiselenium.java   
/**
 * Finds all elements within the search context using the given mechanism. <br/>
 * An empty list will be returned if the elements couldn't be found. <br/>
 * 
 * @param clazz The class of the elements.
 * @param by The locating mechanism to use.
 * @param searchContext The search context.
 * @return The list of elements.
 * @since 0.3.0
 */
public static <E> List<E> findElements(Class<E> clazz, By by, SearchContext searchContext) {
    List<WebElement> webElements = searchContext.findElements(by);
    if (webElements.isEmpty()) return Lists.newArrayList();

    WiseDecorator decorator = new WiseDecorator(new DefaultElementLocatorFactory(searchContext));
    return decorator.decorate(clazz, webElements);
}
项目:wiselenium    文件:Wiselenium.java   
/**
 * Decorates a webElement.
 * 
 * @param clazz The class of the decorated element. Must be either WebElement or a type
 * annotated with Component or Frame.
 * @param webElement The webElement that will be decorated.
 * @return The decorated element or null if the type isn't supported.
 * @since 0.3.0
 */
public static <E> E decorateElement(Class<E> clazz, WebElement webElement) {
    WiseDecorator decorator = new WiseDecorator(new DefaultElementLocatorFactory(webElement));
    return decorator.decorate(clazz, webElement);
}