(转)selenuim-webdriver注解之@FindBy、@FindBys、@FindAll的区别
selenium-webdriver中获取页面元素的方式有很多,使用注解获取页面元素是其中一种途径,
方式有3种:@FindBy、@FindBys、@FindAll。下文对3中类型的区别和使用场景进行介绍
1)@FindBy
@FindBy(id= "A")
private WebElement A;
2)@FindBys
@Findbys({
@FindBy(className = "A"),
@FindBy(className = "B")
})
public WebElement AB;
@FindBys 相当于是取交集,是先根据第一个注解获取到对应元素,然后根据第二个注解再帅选出对应的页面元素,。如先找到符合classname=A的元素,再在这些元素集中找到classname=B的所有元素
就像如下操作:
driver.findElement(<By_FindByA>).findElement(<By_FindByB>).
3)@FindAll
@FindAll({
@FindBy(id = "A"),
@FindBy(id = "B")
})
public List<WebElement> aAndB;
@FindAll相当于是取并集,如找到id=A和id=B的所有元素
内容转自:
http://www.cnblogs.com/hushaojun/p/5591225.html
(转)selenuim-webdriver注解之@FindBy、@FindBys、@FindAll的区别的更多相关文章
- 缓冲区 粘包 029 send 和sendall 的区别 find 和 findall 的区别
一.tcp : 属于长连接 与客户端连接了之后 其他客户端需要等待 要连接另外一个 必须优雅的断开前面这个客户的连接. 二.缓冲区 :为了避免网络传输信号不通畅而是程序一直停留在消息发送状态而不向下进 ...
- selenuim-webdriver注解之@FindBy、@FindBys、@FindAll的区别
selenium-webdriver中获取页面元素的方式有很多,使用注解获取页面元素是其中一种途径, 方式有3种:@FindBy.@FindBys.@FindAll.下文对3中类型的区别和使用场景进行 ...
- @FindBy、@FindBys、@FindAll的区别
原文地址http://blog.csdn.net/tea_wu/article/details/21080789 selenium-webdriver中获取页面元素的方式有很多,使用注解获取页面元素是 ...
- selenuim,webdriver 基础3
代码要多敲 注释要清晰 哪怕很简单 对基础1和2 的补充 可以结合1和2来学习 from selenium import webdriver #生成浏览器对象 driver = webdriver.P ...
- SpringMVC中注解@RequestBody和@ResponseBody的使用区别
首先上源码 在面试时经常会问到我们如何使用SpringMVC将Http请求转换为java对象,或者又是问如何将结果转换为java的呢? SpringMVC在接收到请求之后HandlerMapping像 ...
- Spring 注解中@Resource 和 @Authwired 的区别
@Resource的作用相当于@Autowired,只不过@Autowired按byType自动注入,而@Resource默认按 byName自动注入罢了.@Resource有两个属性是比较重要的,分 ...
- spring配置注解context:annotation-config和context:component-scan区别
Spring 中在使用注解(Annotation)会涉及到< context:annotation-config> 和 < context:component-scan>配置, ...
- Python:正则表达式(一):search()、match()、findall() 的区别
以前一直觉得正则很难,不会用,今天试验了几个方法,整理总结了一下,简洁明了. 简单来讲,正则就是 提取一段特征数据,用(.*?)代替. 自己总结的特点&区别: (.*) 贪婪匹配,会尽可能的往 ...
- 缓存中,2个注解:@cacheable 与 @cacheput 的区别
@cacheable:只会执行一次,当标记在一个方法上时表示该方法是支持缓存的,Spring会在其被调用后将其返回值缓存起来,以保证下次利用同样的参数来执行该方法时可以直接从缓存中获取结果. @cac ...
随机推荐
- PIC32MZ tutorial -- UART Communication
At this moment, I accomplish the interface of UART communication for PIC32MZ EC Starter Kit. This in ...
- ipython notebook设置工作路径和自动保存.py文件 ipython_notebook_config.py
在安装完Anaconda,选择了配置环境变量后,打开cmd命令行 1. 打开命令行, 键入 ipython profile create 2. 键入 , 根据这个地址, 打开profile所在的文件夹 ...
- Gson---简单入门
1-1.Diaosi.java(bean) package Bean; import com.google.gson.annotations.SerializedName; public class ...
- ---Linux 10 年的硕果累累啊!
http://mt.sohu.com/20160128/n436204298.shtml
- IDL中的HRESULT值
IDL中的HRESULT值
- php上传大文件设置方法
打开php.ini,首先找到 ;;;;;;;;;;;;;;;; ; file uploads ; ;;;;;;;;;;;;;;;; 区域,有影响文件上传的以下几个参数: file_uploads = ...
- win8.1 64位安装DEV C++
1.首先下载64位版本的DEV C++ http://sourceforge.net/projects/orwelldevcpp/files/Setup%20Releases/ 2.采取默认安装即可, ...
- UIImagePickerController的知识点
1.UIImagePickerController是系统提供的用来获取图片或视频的接口,使用UIImagePickerController类来获取图片的基本步骤如下: a.初始化UIImagePick ...
- java中 DigestUtils.md5Hex 的c#实现
C# string target= "央行降息影响楼市:100万20年期房贷月供减少141元"; string result = Md5Helper.Md5Hex(aa); //r ...
- poj1157LITTLE SHOP OF FLOWERS
Description You want to arrange the window of your flower shop in a most pleasant way. You have F bu ...