脚本样式一
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
case1
open browser http://192.168.1.101:8080/ssmgrogshop chrome #打开指定url
sleep 0.5 \ #睡眠时间s
Comment set window size 500 600 #宽/高
maximize browser window #窗口最大化
sleep 0.5
input text //input[@name="userName"] group1 #用户名
sleep 0.5
input password //input[@name="password"] 123456 #密码
sleep 0.5
click element //*[@onclick="$('#form1').submit()"] #登录
sleep 2
click element //*[@id="roomManageId"] #展开目录
sleep 0.5
click element //*[@id="commoditySetId"] #点击商品管理
sleep 0.5
select frame //iframe[@id="Mainid"] #进入iframe内嵌窗口
sleep 0.5
click element //*[@value="57"] #选中指定复选框
sleep 0.5
click element //*[@onclick="deletefunction()"] #点击删除
sleep 1
handle alert action=ACCEPT timeout=1 min #弹框确认(ACCEPT) 弹框取消(DISMISS)
sleep 1
unselect frame #退出iframe
sleep 2
close window #关闭当前窗口
Comment close all window #关闭全部窗口
脚本样式二