*** 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关键字介绍的更多相关文章

  1. Robot Framework常用关键字介绍

    常用关键字介绍 在学习一门编程语言的时候,大多教材都是从打印“hello world”开始.我们可以像编程语言一样来学习 Robot Framework.虽然通过 RIDE 提供“填表”一样的写测试用 ...

  2. robot framework 常用关键字介绍

    1.log 打印所有内容 log hello word 2.定义变量 ${a} Set variable 92 log ${a}   3.连接对象 ${a} Catenate hello word l ...

  3. Robot Framework - 基础关键字 BuiltIn 库(二)

    本篇教程,我们继续接着上篇内容进行讲解,我们本节教程讲解的是Robot Framework 机器人框架中的变量中使用判断.字符串的拼接.Evaluate的用法.调用Python文件.条件分支语句.以及 ...

  4. Robot Framework - 基础关键字 BuiltIn 库(一)

    今天给大家分享的是Robot Framework 机器人框架中 BuiltIn 基础库的使用...BuiltIn 库里面提供了很多基础方法助力于我们在自动化测试领域中做的更好!——本系列教程是教会大家 ...

  5. Robot Framework 接口自动化介绍

    接口测试的重要性大家应该都清楚,就不多说了,本文中主要介绍接口测试如何在robot framework自动化测试框架中进行. 一.环境依赖 1.安装robot framework环境,本文中不做讲解 ...

  6. Robot Framework常用关键字

    虽然通过RIDE提供"填表"一样的写测试用例的方式.但它却支持强大的关键字功能,以及可以开发关键字的扩展能力. Comment 注释功能,也可以使用python中的"#& ...

  7. Robot Framework 自定义关键字 Ignore error

    以上是关键字的完整写法. 一下是调用该关键字的实例.

  8. Robot Framework 常用关键字使用方法

    1. Select From Listid=sourceConnoracle_source 从下拉框选取值. 2. Select Radio button  name value 选择单选框.也可以点 ...

  9. robot framework 的关键字Continue For Loop 用法

    Continue For Loop关键字就是python的continue的意思,跳出本层循环,继续执行下一个循环. 我先举个栗子: :FOR    ${index}    IN RANGE    5 ...

随机推荐

  1. [agc006E]Rotate 3x3

    Description 给你一个3*N的网格,位置为(i,j)的网格上的数为i+3(j-1).每次选一个3*3的网格旋转180度,问最后能否使得网格(i,j)的值为ai,j.(5≤N≤105) 如图: ...

  2. 【转载】TCP/IP 之 大明王朝邮差

    原文:TCP/IP 之 大明王朝邮差 原创 2016-05-12 刘欣 码农翻身 前言: 本文主要想说一下TCP的知识, 比喻有不恰当之处,敬请包涵. 大明王朝天启四年, 清晨. 天色刚蒙蒙亮,我就赶 ...

  3. day5 if while for

    .注意点: ctrl + n 自动补全 18行报错,直接定位18行 逻辑运算符and or not 复合赋值运算符 += .if-elif 判断星期几 猜拳游戏 .while循环 )3大执行流程 )什 ...

  4. OpenStack入门篇(七)之认证服务Keystone

    一.Keystone的概述 Keystone是Openstack的组件之一,用于为Openstack家族中的其它组件成员提供统一的认证服务,包括身份验证,令牌的发放和校验,服务列表,用户权限的定义等. ...

  5. Spring学习(十二)-----Spring @PostConstruct和@PreDestroy实例

    实现 初始化方法和销毁方法3种方式: 实现标识接口 InitializingBean,DisposableBean(不推荐使用,耦合性太高) 设置bean属性 Init-method destroy- ...

  6. 查看Linux系统版本的命令

    1.lsb_release -a,即可列出所有版本信息: [root@S-CentOS ~]# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0 ...

  7. C、C++字符操作归总

    1)字符串操作 strcpy(p, p1) 复制字符串 strncpy(p, p1, n) 复制指定长度字符串 strcat(p, p1) 附加字符串 strncat(p, p1, n) 附加指定长度 ...

  8. JMeter学习笔记(二) 一些实际应用的基础操作

    我在CSDN上面找到一位大师整理的jmeter性能测试基础,分享到这里继续学习 https://blog.csdn.net/u011541946/article/category/6893578/1

  9. NO.1:自学tensorflow之路------神经网络背景知识

    引言 从本周,我将开始tensorflow的学习.手头只有一本<tensorflow:实战Google深度学习框架>,这本书对于tensorflow的入门有一定帮助.tensorflow中 ...

  10. Docker入门与实践之 docker安装与了解

    一.Docker 概述 Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源.Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后 ...