* Settings *
Library Selenium2Library
* Keywords *
[Arguments] ${url} ${browser}
[Documentation] 打开浏览器
open browser ${url} ${browser}
[Documentation] 最大化窗口
Maximize Browser Window
[Arguments] ${time}
[Documentation] 等待时间
sleep ${time}
[Arguments] ${location} ${value}
[Documentation] 文本框输入
input text ${location} ${value}
[Arguments] ${location}
[Documentation] 点击按钮
click button ${location}
[Arguments] ${location}
[Documentation] 点击元素
click element ${location}
[Arguments] ${location}
[Documentation] 点击链接
click link ${location}
[Arguments] ${location}
[Documentation] 鼠标滑动
mouse over ${location}
[Documentation] 截图
Capture Page Screenshot
[Arguments] ${JSContent}
[Documentation] 执行JS
Execute JavaScript ${JSContent}
[Arguments] ${location}
[Documentation] 选择Frame
Select Frame ${location}
[Arguments] ${location} ${time} ${error} # 元素|等待时间|输出错误
[Documentation] 等待元素
wait until element is visible ${location} ${time} ${error}
[Arguments] ${location}
[Documentation] 勾选框
Select Checkbox ${location}
[Arguments] ${group} ${value}
[Documentation] 单选框
Select Radio Button ${group} ${value}
[Arguments] ${type} ${location} @{value} # type:label、value,按照label还是value来定位,默认为label
[Documentation] 复选框选择
run keyword if ${type}=='value' Select From List By value ${location} @{value}
\ else Select From List By label ${location} @{value}
[Teardown]
[Arguments] ${type} ${location} @{value} # type:label、value,按照label还是value来定位,默认为label
[Documentation] 下拉框选择
run keyword if ${type}=='value' Select From List By value ${location} @{value}
\ else Select From List By label ${location} @{value}
[Teardown]
[Arguments] ${location} ${expected}
[Documentation] 判断文本正确性
element text should be ${location} ${expected}
Run Keyword If '${addr.status_code}' == '200' Log 接口返回状态码正常
... ELSE Log 接口返回状态码错误!