(1)0pen browser [url,browser=firefox,alias] 打开浏览器,访问网址
(2)Maximize Browser Window [ ] 最大化浏览器
(3)reload page [ ] 重新加载页面
(4)sleep (秒数) 休眠
=====================================
(5)go to [url] 当前窗口访问指定url
(6)go back [ ] 返回上一步
=====================================
(7)nput text [locator,text] 文本框输入
(8)input password [locator,password] 密码框输入
(9)click button [locator] 点击按钮
(10)click element [locator]点击元素
网站:http://cms.duoceshi.cn/cms/manage/login.do
=====================================
click link [locator/link text] 点击链接
switch browser [alias] 切换浏览器
select window [locator=main] 选择窗口
close window [ ] 关闭当前窗口
close browser [ ] 关闭当前浏览器
close all browsers [ ] 关闭所有浏览器
(1)通过索引切换窗口
(2)通过 别名切换浏览器
(3)同一个浏览器,切换窗口
(4)关闭浏览器和关闭当前窗口
=========================================
get title [ ] 获取当前窗口title
title should be [title] 验证当前窗口的title
get text [locator] 获取文本信息
get value [locator] 获取value属性值
get element attribute [locator,attribute] 获取元素的某个属性值
get window size [ ] 获取窗口的大小
(1)
(2)
(3)
=========================================
select radio button [group_name,value] 选择单选按钮
select checkbox [locator] 选择复选按钮
select from list by index [locator,index] 通过下标定位下拉选项
select from list by value [locator,value] 通过value值定位下拉选项
select from list by label [locator,label] 通过下拉文本定位下拉选选项
案例:
file:///E:/dcs/two/selenium%EF%BC%888%EF%BC%89/html%E5%BC%B9%E6%A1%86/table.html
================================================
select frame [locator] 进入frame
unselect frame [ ] 退出frame
网站:https://graph.qq.com/oauth2.0/show?which=Login&display=pc&response_type=code&state=B8EA15AF292E3BD4D4A7D5A16302534700909265BBE6E325F079DB4BC990D3EEBA9A5DFFADB26DF7B6D47DD0E4300E83&client_id=100273020&redirect_uri=https%3A%2F%2Fqq.jd.com%2Fnew%2Fqq%2Fcallback.action%3Fview%3Dnull%26uuid%3Da53007e4416f4a8e969028431bd3027d
================================================
mouse over [locator] 鼠标移动到某个元素上面
================================================
弹框:
handle alert [action=accept] 弹框确认
弹框链接:
file:///E:/dcs/two/selenium%EF%BC%888%EF%BC%89/html%E5%BC%B9%E6%A1%86/alert%E5%BC%B9%E6%A1%86.html
============================
滚动条:
============================
Assign Id To Element [locator,id] 分配一个id给某个元素
案例:
=============================
Get Table Cell [locator,row,column] 获取表格单元格的数据
案例:
==============================
page should cotain[text] 验证页面包含文本
page should not contain [text] 验证页面不包含文本
page should cotain element [locator] 验证页面包含元素
page should not contain element [locator] 验证页面不包含元素
Wait Until page Contains [text,timeout,error] 等待直到页面包含文本
wait until page does not contain [text,timeout,error] 等待页面不包含文本
wait until page contains element [locator,timeout,error] 等待页面包含元素
wait until page does not contain element [locator,timeout,error]
等待页面不包含元素
等待页面不包含元素