robot framework Selenium2关键字介绍
*** Settings ***
Library Selenium2Library *** Keywords ***
Checkbox应该不被选择
[Arguments] ${locator}
Checkbox Should Not Be Selected ${locator} Frame应该包含文本
[Arguments] ${locator} ${text} ${loglevel}=INFO
Frame Should Contain ${locator} ${text} ${loglevel} List应该无选项
[Arguments] ${locator}
List Should Have No Selections ${locator} List选项应该是
[Arguments] ${locator} @{items}
List Selection Should Be ${locator} @{items} Radio按钮不应该被选择
[Arguments] ${group_name}
Radio Button Should Not Be Selected ${group_name} Radio按钮应该被设置成
[Arguments] ${group_name} ${value}
Radio Button Should Be Set To ${group_name} ${value} Url应该包含
[Arguments] ${expected}
Location Should Contain ${expected} Xpath应该匹配X次
[Arguments] ${xpath} ${expected_xpath_count} ${msg}= ${loglevel}=INFO
Xpath Should Match X Times ${xpath} ${expected_xpath_count} ${msg} ${loglevel} checkbox应该被选择
[Arguments] ${locator}
checkbox should be selected ${locator} url应该是
[Arguments] ${url}
Location Should Be ${url} 下次确认选择取消
Choose Cancel On Next Confirmation 下次确认选择确定
Choose Ok On Next Confirmation 从List中取消选项
[Arguments] ${locator} @{items}
Unselect From List ${locator} @{items} 从List选择选项
[Arguments] ${locator} @{items}
Select From List ${locator} @{items} 偏移拖拽
[Arguments] ${source} ${xoffset} ${yoffset}
Drag And Drop By Offset ${source} ${xoffset} ${yoffset} 元素应该不包含文本
[Arguments] ${locator} ${expected} ${msg}=
Element Should Not Contain ${locator} ${expected} ${msg} 元素应该不可用
[Arguments] ${locator}
Element Should Be Disabled ${locator} 元素应该不可见
[Arguments] ${locator} ${msg}=
Element Should Not Be Visible ${locator} ${msg} 元素应该包含文本
[Arguments] ${locator} ${text}
Element Should Contain ${locator} ${text} 元素应该匹配x次
[Arguments] ${locator} ${count} ${msg}= ${loglevel}=INFO
Locator Should Match X Times ${locator} ${count} ${msg} ${loglevel} 元素应该可用
[Arguments] ${locator}
Element Should Be Enabled ${locator} 元素应该可见
[Arguments] ${locator}
Element Should Be Visible ${locator} 元素文本应该是
[Arguments] ${locator} ${expected} ${msg}=
Element Text Should Be ${locator} ${expected} ${msg} 全选List元素
[Arguments] ${locator}
Select All From List ${locator}![]()
关闭所有浏览器
Close All Browsers 关闭浏览器
Close Browser close browser 关闭当前的浏览器。close all browser 关键所有打开的浏览器和缓存重置。
Maximize Browser Window 关键字使当前打开的浏览器全屏。
get windows size 关键字用于打设置打开浏览器的宽度和高度。以像素为单位,第一个参数 800 表示宽
度,第二个参数 600 表示高度。
关闭窗口
Close Window 切换浏览器
[Arguments] ${index}
Switch Browser ${index} 创建Webdriver
[Arguments] ${driver_name} ${alias}= ${kwargs}={}
Create Webdriver ${driver_name} ${alias} ${kwargs} 删除Cookie
[Arguments] ${name}
Delete Cookie ${name} 删除所有Cookie
Delete All Cookies 删除本地策略
[Arguments] ${strategy_name}
Remove Location Strategy ${strategy_name} 刷新页面
Reload Page 双击元素
[Arguments] ${locator}
Double Click Element ${locator} 取消选择Checkbox
[Arguments] ${locator}
Unselect Checkbox ${locator} 取消选择Frame
Unselect Frame 回退
Go Back 在图片上按下鼠标左键
[Arguments] ${locator}
Mouse Down On Image ${locator}
重复多次操作
repeat keyword ${num} ${operation}
Open Browser 打开浏览器,参数包括url | browser=xx | alias=xx 等
Click Link 点击一个超链接,参数是一个locator
Click Element 点击一个元素,如单选框、复选框、按钮等
Click Button 点击一个button,必须是button元素,应用场景少
Input Text 输入文本,参数包括 Locator | Text
Select Frame / Unselect Frame 选择进入 / 退出某个iframe,当页面中包含iframe是注意使用这个关键字,不然会定位不到元素
Wait Until Page Contains 等待页面中出现某个文本后才进行下一步操作
should be equal 是指两个对象相等,should match 是匹配模式,可用通配符
Get Table Cell 可以更直接的获取表格的内容
Get Element Attribute 获取某个元素的属性
Evaluate是执行python表达式,并返回执行结果
creat list 创建列表
get time 获取当前时间
screenshot 库
robot framework Selenium2关键字介绍的更多相关文章
- Robot Framework常用关键字介绍
常用关键字介绍 在学习一门编程语言的时候,大多教材都是从打印“hello world”开始.我们可以像编程语言一样来学习 Robot Framework.虽然通过 RIDE 提供“填表”一样的写测试用 ...
- robot framework 常用关键字介绍
1.log 打印所有内容 log hello word 2.定义变量 ${a} Set variable 92 log ${a} 3.连接对象 ${a} Catenate hello word l ...
- Robot Framework - 基础关键字 BuiltIn 库(二)
本篇教程,我们继续接着上篇内容进行讲解,我们本节教程讲解的是Robot Framework 机器人框架中的变量中使用判断.字符串的拼接.Evaluate的用法.调用Python文件.条件分支语句.以及 ...
- Robot Framework - 基础关键字 BuiltIn 库(一)
今天给大家分享的是Robot Framework 机器人框架中 BuiltIn 基础库的使用...BuiltIn 库里面提供了很多基础方法助力于我们在自动化测试领域中做的更好!——本系列教程是教会大家 ...
- Robot Framework 接口自动化介绍
接口测试的重要性大家应该都清楚,就不多说了,本文中主要介绍接口测试如何在robot framework自动化测试框架中进行. 一.环境依赖 1.安装robot framework环境,本文中不做讲解 ...
- Robot Framework常用关键字
虽然通过RIDE提供"填表"一样的写测试用例的方式.但它却支持强大的关键字功能,以及可以开发关键字的扩展能力. Comment 注释功能,也可以使用python中的"#& ...
- Robot Framework 自定义关键字 Ignore error
以上是关键字的完整写法. 一下是调用该关键字的实例.
- Robot Framework 常用关键字使用方法
1. Select From Listid=sourceConnoracle_source 从下拉框选取值. 2. Select Radio button name value 选择单选框.也可以点 ...
- robot framework 的关键字Continue For Loop 用法
Continue For Loop关键字就是python的continue的意思,跳出本层循环,继续执行下一个循环. 我先举个栗子: :FOR ${index} IN RANGE 5 ...
随机推荐
- 客户端与服务器端同步Evernote
原文地址:http://www.zhihu.com/question/20238731 Evernote的同步方式是 以本地为基准同步到网络 还是 以网络为基准同步到本地 的? 若客户端从未与服务器端 ...
- 【转载】从零实现3D图像引擎:(1)环境配置与项目框架
原文:从零实现3D图像引擎:(1)环境配置与项目框架 0. 要学懂3D程序设计,必然要精通3D相关的线性代数.3D几何.复分析等相关知识,我也因为如此才开始这个博客系列的写作,不自己实现,就不是自己的 ...
- 【BZOJ4566】[HAOI2016]找相同字符
[BZOJ4566][HAOI2016]找相同字符 题面 给定两个字符串,求出在两个字符串中各取出一个子串使得这两个子串相同的方案数.两个方案不同当且仅当这两个子串中有一个位置不同. 其中\(1\le ...
- javaweb(十四)——JSP原理
一.什么是JSP? JSP全称是Java Server Pages,它和servle技术一样,都是SUN公司定义的一种用于开发动态web资源的技术. JSP这门技术的最大的特点在于,写jsp就像在写h ...
- sql server数据库中char,varchar,nvarchar字段的区别
Char,varchar,nvarchar字段是sql server数据库中的三种字段类型.好多人在选择存储的时候不知道如何抉择,我给大家讲下这个三个字段类型的区别. Char(n)是长度为n个字节的 ...
- 视觉SLAM中的深度估计问题
一.研究背景 视觉SLAM需要获取世界坐标系中点的深度. 世界坐标系到像素坐标系的转换为(深度即Z): 深度的获取一共分两种方式: a)主动式 RGB-D相机按照原理又分为结构光测距.ToF相机 To ...
- WebGL中使用window.requestAnimationFrame创建主循环
今天总结记录一下WebGL中主循环的创建和作用.我先说明什么是主循环,其实单纯的webgl不存在主循环这个概念,这个概念是由渲染引擎引入的,主循环就是利用一个死循环或无截止条件的递归达到定时刷新can ...
- Unity Lighting - Reflections 反射(六)
Reflections 反射 Reflection Source 反射源 By default, objects in a scene are rendered using Unity’s ‘St ...
- 袋鼠云旗下新公司云掣科技启航,深耕云MSP业务助推企业数字化转型
1983年3月15日,国际消费者联盟组织将3月15日确立为国际消费者权益日. 2019年3月15日,袋鼠云举办三周年年会. 一生二,二生三,三生万物.植树节后,万物生长. 年会现场,袋鼠云宣布成立新公 ...
- 直线石子合并(区间DP)
石子合并 时间限制:1000 ms | 内存限制:65535 KB 描述有N堆石子排成一排,每堆石子有一定的数量.现要将N堆石子并成为一堆.合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费 ...