• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultElementLocatorFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory的典型用法代码示例。如果您正苦于以下问题:Java DefaultElementLocatorFactory类的具体用法?Java DefaultElementLocatorFactory怎么用?Java DefaultElementLocatorFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultElementLocatorFactory类属于org.openqa.selenium.support.pagefactory包,在下文中一共展示了DefaultElementLocatorFactory类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: inject

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
/**
 * 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();
  }
}
 
开发者ID:Cognifide,项目名称:bobcat,代码行数:19,代码来源:PageObjectInjector.java


示例2: HighCharts

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
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);
}
 
开发者ID:gautamsabba,项目名称:UIFramework,代码行数:10,代码来源:HighCharts.java


示例3: initDecorator

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
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;
}
 
开发者ID:wiselenium,项目名称:wiselenium,代码行数:12,代码来源:WisePageFactory.java


示例4: Form

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
public Form(SearchContext context) {
	PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
 
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:4,代码来源:HomePage.java


示例5: Attribute

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
public Attribute(SearchContext context) {
	PageFactory.initElements(new DefaultElementLocatorFactory(context), this);
}
 
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:4,代码来源:HomePage.java


示例6: SelenideAppiumFieldDecorator

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
public SelenideAppiumFieldDecorator(SearchContext context) {
  super(context);
  this.searchContext = context;
  this.factory = new DefaultElementLocatorFactory(searchContext);
}
 
开发者ID:codeborne,项目名称:selenide-appium,代码行数:6,代码来源:SelenideAppiumFieldDecorator.java


示例7: getDefaultPageObjectContext

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
private PageObjectContext getDefaultPageObjectContext(WebDriver webDriver) {
  ElementLocatorFactory elementLocatorFactory = new DefaultElementLocatorFactory(webDriver);
  FramePath framePath = new FramePath();
  return new PageObjectContext(elementLocatorFactory, framePath);
}
 
开发者ID:Cognifide,项目名称:bobcat,代码行数:6,代码来源:ContextStack.java


示例8: HighCharts

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
public HighCharts(WebDriver driver, WebElement chart) {
    PageFactory.initElements(new DefaultElementLocatorFactory(chart), this);
    this.driver = driver;
    this.chart = chart;

}
 
开发者ID:MastekLtd,项目名称:SwiftLite,代码行数:7,代码来源:HighCharts.java


示例9: isReloaded

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:opensource21,项目名称:fuwesta,代码行数:10,代码来源:BasePage.java


示例10: findElements

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:wiselenium,项目名称:wiselenium,代码行数:18,代码来源:Wiselenium.java


示例11: decorateElement

import org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:wiselenium,项目名称:wiselenium,代码行数:14,代码来源:Wiselenium.java



注:本文中的org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FSHDFSUtils类代码示例发布时间:2022-05-22
下一篇:
Java UpdateExecutionFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap