robotframework实战常用判断关键字
1、page should contain #验证页面包含内容
2、Page Should not Contain #验证页面不包含内容
3、Page Should Contain Element 页面包含元素
4、Page Should Not Contain Element 页面不包含元素
5、Wait Until page Contains 等到页面包含
6、Wait Until Page Does Not Contain 等到页面不包含
7、Wait Until Page Contains Element 等到页面包含元素
8、Wait Until Page Does Not Contain Element 等到页面不包含元素
案例1:、page should contain #验证页面包含内容
案例2、Page Should Not Contain #验证页面不包含内容
案例3、 Page Should Contain Element
3.1
Open Browser https://www.baidu.com/ gc #打开百度浏览器
sleep 2 #休眠
Maximize Browser Window #窗口最大化
Comment Page Should Contain Element id=su
案例4: Page Should not Contain Element
3.2.1
3.2.2
案例5:Wait Until Page Contains
案例6:Wait Until Page Does Not Contain
案例7:Wait Until Page Contains Element
案例8:Wait Until Page Does Not Contain Element
hz015判断关键字
Open Browser https://www.baidu.com/ gc #打开百度浏览器
sleep 2 #休眠
Maximize Browser Window #窗口最大化
Comment Wait Until Page Contains Element id=su #页面元素存在,则ok
Comment Wait Until Page Contains Element id=dd #页面元素不存在,则报错
Comment Wait Until Page Does Not Contain Element id=su #页面元素存在,则报错
Wait Until Page Does Not Contain Element id=dd #页面元素不存在,则ok
Comment input text id=kw 杭州多测师
Comment sleep 2
Comment Wait Until Page Contains 杭州多测师 #页面不存在,则报错
Comment Wait Until Page Does Not Contain 杭州多测师 #页面不存在,运行ok
Comment Wait Until Page Does Not Contain 百度 #页面存在,运行报错
Comment Wait Until Page Contains 百度 #页面存在,则ok
Comment Page Should Not Contain Element id=su #判断存在元素,报错
Comment Page Should Not Contain Element id=kk #判断不存在元素,运行ok
Comment Page Should Contain Element id=su
Comment Page Should Contain Element id=kk
Comment Page Should Contain 百度 #判断页面包含内容存在,运行ok
Comment Page Should Contain 刘旭 ##判断页面包含内容不存在,运行报错
Comment Page Should Not Contain 刘旭 ##判断页面包含内容不存在,运行ok
Comment Page Should Not Contain 百度 #判断页面包含内容存在,运行报错