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

项目:carina    文件:ExtendedFieldDecorator.java   
protected ExtendedWebElement proxyForLocator(ClassLoader loader, Field field, ElementLocator locator)
{
    InvocationHandler handler = new LocatingElementHandler(locator);
    WebElement proxy = (WebElement) Proxy.newProxyInstance(loader, new Class[]
    { WebElement.class, WrapsElement.class, Locatable.class }, handler);
    return new ExtendedWebElement(proxy, field.getName(), field.isAnnotationPresent(FindBy.class) ? new LocalizedAnnotations(field).buildBy() : null, webDriver);
}
项目:bobcat    文件:CurrentWebElementProvider.java   
private WebElement getWebElementFromFactory(ElementLocatorFactory factory) {
  InvocationHandler handler = new LocatingElementHandler(
      ((ParentElementLocatorProvider) factory).getCurrentScope());
  return (WebElement) Proxy.newProxyInstance(WebElement.class.getClassLoader(),
      new Class[] {WebElement.class, WrapsElement.class, Locatable.class}, handler);
}