Robot Framework selenium2library 常用关键字
Selenium Library
SeleniumLibrary is a Robot Framework test library that uses the popular Selenium web testing tool internally. It provides a powerful combination of simple test data syntax and support for different browsers. In addition to standard web testing, the library also supports testing Adobe Flex/Flash applications.
Selenium2Lib keyword:
(1)operate browser:
--Open Browser
--Maximize Browser Window
--Go To
--Reload Page
--Close Window
--Close Browser
--Close All Browsers
(2)click
--Click Button|locator
--Click Element|locator
--Click Image|locator
--Click Link|locator
--Double Click Element|locator
(3)locator:we could locate UI element with id/name/xpath/dom
--identifier: Click Element|identifier=my_element (matches by @id or @name)
--id : Click Element|id=my_element (matches by @id)
--name : Click Element|name=my_element(matches by @name)
--xpath : Click Element|xpath=//div[@id='my_element']
--link : Click Element|link=my_link
--css : Click Element|css=div.my_class
--tag : Click Element|tag=div
ps:if the element is in a frame/iframe,we could locate it by : Select Frame| locator
(4)input
--Input Password|locator| text
--Input Text|locator|text
(5)press
--Press Key|locator|Key
(6) verify:
--Page Should (Not) Contain Button/Checkbox/Element/Image/Link/List/Radio Button/Textfield
--Location should Be/Contain
--Title Should Be
--Current Frame Contains
--Page Should (Not) Contain
--Textfield Value Should Be
--Element Should Be Disabled/Enabled/Visible/Contain
--List Selection Should Be
--List Should Have No Selections
--Checkbox Should (Not) Be Selected
--Radio Button Should Be Set To
--Radio Button Should Not Be Selected
--Table Cell/Column/Footer/Header/Row/ Should Contain
--Xpath Should Match X Times
(7)wait
selenium2 will wait page load finished default,but we can also use keywords:
--Wait For Condition| condition|timeout=None|error=None
--Wait Until Page Contains|text|timeout=None|error=None
--Wait Until Page Contains Element|locator|timeout
Robot Framework selenium2library 常用关键字的更多相关文章
- Robot Framework自动化_Selenium2Library 关键字
Robot Framework自动化_Selenium2Library 关键字 培训老师:肖能尤 2016/06/12 课程目的 一.Robot framework Selenium2Library ...
- Robot Framework + Selenium2Library环境下,结合Selenium Grid实施分布式自动化测试
最近一段时间,公司在推行自动化测试流程,本人有幸参与了自定义通用控件的关键字封装和脚本辅助编写.数据驱动管理.测试用例执行管理等一系列工具软件的研发工作,积累了一些经验,在此与大家做一下分享,也算是做 ...
- Robot Framework开发系统关键字详细
本文的目的,是记录如何在rf下,开发属于自己的库函数(又称之系统关键字) 1.首先在..\Python27\Lib\site-packages目录下创建自定义库目录如Verification_Libr ...
- Robot framework(RF) 用户关键字
3.6 用户关键字 在Robot Framework 中关键字的创建分两种:系统关键字和用户关键字. 系统关键字是需要通过脚本开发相应的类和方法,从而实现某一逻辑功能. 用户关键字是根据业务的需求利 ...
- [Robot Framework] SikuliLibrary的关键字执行依赖java进程,但是上次的java进程如果没有杀掉,robot framework控制台的日志出不来,怎么办?
如果在suite的setup里面杀掉java进程:AutoItLibrary.Run | taskkill /F /IM java.exe 执行sikuli的关键字会报这样的错误: Connectio ...
- Robot Framework(用户关键字)
在 Robot Framework 中关键字的创建分两种:系统关键字和用户关键字.系统关键字需要通过脚本开发相应的类和方法,这个我们将在后面的章节介绍.用户关键字的创建就要简单得多,它主要利用现有的系 ...
- robot framework selenium2library定位
进行页面元素操作,最麻烦的莫过于元素定位了,经常提示element is not visible 或者element is not exist 下面介绍常见的定位方法和定位中的问题 1 使用name和 ...
- robot framework Selenium2library wait小问题
最近在使用selenium2Library时,用到其中的 Wait Until Page函数,因我们的网页相对比较敏感,经常获取不到,不明觉历 看看源码吧,如下: def wait_until_pag ...
- Robot Framework封装的关键字输入参数可以传入多个值的方法
输入参数的最后一个参数可以是一个列表变量,通过@{列表名称}或者${列表名称}的方式实现传入多个值的场景: 或者
随机推荐
- niop 2014寻找道路
/* 乍一看就是个最短路 SFPA 但是要保证路径上的所有点的出边所指向的点都直接或间接与终点连通. 这一点就蛋疼了0.0 开始想的是正着跑一边 每一个点的所有边都能符合条件 那这个点就符合条件0.0 ...
- ADLINK 8158控制程序-连续运动(VB.NET)
运动平台:日脉的二维运动平台(一个旋转平台和一个滑动平台) 开发环境:VS2010 + .NET Framework + VB.NET 使用文件:pci_8158.vb motion_8158_2D. ...
- VB 增强的部件与引用
常用部件 对话框 Microsoft Common Dialog Control 6.0 (sp6) COMDLG32.OCX Forms2.0控件 Microsoft Forms 2. ...
- Sql语句 不支持中文 国外数据库
由于老美的不支持中文 SQL 语句第一:字段类型改为nvarchar,ntext 第二:强制转化 N update dbo.Role set rolename=N'普通用户' update dbo.T ...
- 解决Windows8前面板耳机无声的问题
Windows8已经到来不久了,相信很多朋友已经在使用,在使用时也许会遇到前面板耳机无声的问题,网上的其他办法很麻烦还不一定能解决,在这里我会给大家提供最简单的办法解决这个问题. 百度经验:jingy ...
- 面试题——分析从输入url到页面返回的过程(或者查询返回过程)
1. You enter a URL into the browser(输入一个url地址) 2.The browser looks up the IP address for the domain ...
- 【转】UITextView的使用详解
//初始化并定义大小 UITextView *textview = [[UITextView alloc] initWithFrame:CGRectMake(20, 10, 280, 30)]; te ...
- Unable to locate package错误解决办法
新装了VMWare Player,结果装上Ubuntu12.04后安装软件都提示:Unable to locate package错误,解决方法非常简单,终端输入以下命令即可: sudo apt-ge ...
- js 判断url的?后参数是否包含某个字符串
function GetQueryString(name){ var reg=eval("/"+name+"/g"); var r = window. ...
- Tinkphp定时发布文章的教程
第一步:在文章表中加一个字段,用来保存定时发布的时间 假定我把这个字段设为 push_time 默认为 0 第二步:写一个方法来检查文章列表,把文章列表到时间的文章改为发布状态 //定时发布文章 pu ...