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 常用关键字的更多相关文章

  1. Robot Framework自动化_Selenium2Library 关键字

    Robot Framework自动化_Selenium2Library 关键字 培训老师:肖能尤 2016/06/12 课程目的 一.Robot framework Selenium2Library ...

  2. Robot Framework + Selenium2Library环境下,结合Selenium Grid实施分布式自动化测试

    最近一段时间,公司在推行自动化测试流程,本人有幸参与了自定义通用控件的关键字封装和脚本辅助编写.数据驱动管理.测试用例执行管理等一系列工具软件的研发工作,积累了一些经验,在此与大家做一下分享,也算是做 ...

  3. Robot Framework开发系统关键字详细

    本文的目的,是记录如何在rf下,开发属于自己的库函数(又称之系统关键字) 1.首先在..\Python27\Lib\site-packages目录下创建自定义库目录如Verification_Libr ...

  4. Robot framework(RF) 用户关键字

    3.6  用户关键字 在Robot Framework 中关键字的创建分两种:系统关键字和用户关键字. 系统关键字是需要通过脚本开发相应的类和方法,从而实现某一逻辑功能. 用户关键字是根据业务的需求利 ...

  5. [Robot Framework] SikuliLibrary的关键字执行依赖java进程,但是上次的java进程如果没有杀掉,robot framework控制台的日志出不来,怎么办?

    如果在suite的setup里面杀掉java进程:AutoItLibrary.Run | taskkill /F /IM java.exe 执行sikuli的关键字会报这样的错误: Connectio ...

  6. Robot Framework(用户关键字)

    在 Robot Framework 中关键字的创建分两种:系统关键字和用户关键字.系统关键字需要通过脚本开发相应的类和方法,这个我们将在后面的章节介绍.用户关键字的创建就要简单得多,它主要利用现有的系 ...

  7. robot framework selenium2library定位

    进行页面元素操作,最麻烦的莫过于元素定位了,经常提示element is not visible 或者element is not exist 下面介绍常见的定位方法和定位中的问题 1 使用name和 ...

  8. robot framework Selenium2library wait小问题

    最近在使用selenium2Library时,用到其中的 Wait Until Page函数,因我们的网页相对比较敏感,经常获取不到,不明觉历 看看源码吧,如下: def wait_until_pag ...

  9. Robot Framework封装的关键字输入参数可以传入多个值的方法

    输入参数的最后一个参数可以是一个列表变量,通过@{列表名称}或者${列表名称}的方式实现传入多个值的场景: 或者

随机推荐

  1. shell 求总分

    求总分并且输出: 文件a.txt 学号 姓名 性别 年龄 张三 男 赵四 男 李丽 女 文件b.txt 学号 语文 数学 英语 方法1: #!/bin/sh paste a.txt b.txt ccc ...

  2. The requested URL ***** was not found on this serve

    Wamp的Alias具体是干什么用的,后面要研究一下!!!! 我是之前创建了一个站点用Alias,后来把站点文件移到了www下后,除了首页都访问不了了.显示“The requested URL *** ...

  3. jqPlot,一个 jQuery这个 JavaScript 框架的绘图插件

    因为项目中需要做报表的功能,于是学习了如何使用jqplot这个绘图插件 结合ajax技术,动态交互后台数据 前前后后花了三四天的时间. 感觉它会出来的想说还可以. 我的后台模板是bootstrap,在 ...

  4. VB php JAVA关于数据库连接数过多的解决方法

    这里讲解一个关于数据库连接多多的解决办法 一般都会在方法中进行数据库的开,利用和关 不过如果在一个循环里面使用的时候 这样数据库的连接数就会过多,如果是1万次的话,数据库服务器可能就会当机 PHP 中 ...

  5. C#比较dynamic和Dictionary性能

    开发中需要传递变参,考虑使用 dynamic 还是 Dictionary(准确地说是Dictionary<string,object>).dynamic 的编码体验显著优于 Diction ...

  6. 想加入一行代码吗?使用<code>标签

    在介绍语言技术的网站中,避免不了在网页中显示一些计算机专业的编程代码,当代码为一行代码时,你就可以使用<code>标签了,如下面例子: <code>var i=i+300;&l ...

  7. 【转】lua random()

    先来看看这两段代码: ① math.randomseed(os.time())for i=1,10 do n = math.random(10) print(n) 运行结果是: 63210754341 ...

  8. win10开始菜单打不开的解决办法

    解决方法: 1.在Win10系统下按Win+R打开运行,输入services.msc回车打开服务: 2.在服务中找到User Manager服务;3.打开usermanager服务属性,将其启动类型设 ...

  9. 文件操作-php

    <?php /* 建立缓存 可以用文件长时间保存数据 文件是以liunux为模型的 在Windows下只能获取file ,dir unknow linux 下可以获取block char dir ...

  10. jQuery学习之过滤选择器

    基本过滤选择器 :first 选取第一个元素:$("div:first") :last 选取最后一个元素:$("div:last") :not(selector ...