WEB中的下拉框比较常见,以下是对下拉框的初步尝试操作:
1、进入新增页面,点击新增按钮,检查页面下拉框的默认选项为【女】
2、输入姓名、年龄、电话
3、下拉框选择课程信息
[Arguments] ${name} ${age} ${phone}
click element xpath=.//li[@id='SignUp'] #点击学员报名菜单
click element xpath=.//a[@class='tt_btn tt_right'] #点击新增按钮
Page Should Contain Element xpath=.//select[@id='Gender'] #进入新增页面
List Selection Should Be xpath=.//select[@id='Gender'] 女 #检查默认性别为女
input text xpath=.//*[@id='RegistrationName'] ${name} #输入姓名信息
input text xpath=.//*[@id='Age'] ${age} #输入年龄信息
input text xpath=.//*[@id='RegistrationPhone'] ${phone}
List Selection Should Be xpath=.//select[@id='PeriodId'] 请选择
Select From List by index xpath=.//select[@id='PeriodId'] 1 #选择课程
sleep 1
click button xpath=.//*[@type='submit']
Page Should Contain Element xpath=.//a[@class='tt_btn tt_right']