一、百度搜索实例
前面已经举例过百度搜索的一个例子,这次用上后面的学习到的关键字再复习下
*** Settings ***
Library Selenium2Library
*** Test Cases ***
baidu_search_case
Open Browser http://www.baidu.com chrome
Input Text id=kw selenium
Click Button id=su
sleep 2
${title} Get Title
should contain ${title} selenium_百度搜索
close Browser
二、邮箱登录实例
主要使用select frame关键字切换表单,登录按钮要用click element关键字
*** Settings ***
Library Selenium2Library
*** Test Cases ***
login_mail_case
Open Browser https://www.126.com chrome
sleep 3
Select Frame xpath=//div[@id="loginDiv"]/iframe
Input Text name=email username
Input Text name=password password
Click element id=dologin
Unselect Frame
Close Browser