RF - 完整用例展示
生活随笔
收集整理的這篇文章主要介紹了
RF - 完整用例展示
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
將重復(fù)性動(dòng)作進(jìn)行封裝為keyword,在測(cè)試用例中調(diào)用keyword。
*** Settings *** Documentation Simple example using SeleniumLibrary. Library SeleniumLibrary*** Variables *** ${URL} https://www.baidu.com ${BROWSER} Chrome*** Test Cases *** case1Open Browser ${URL} ${BROWSER}${title} Baidu Search robot frameworkshould contain ${title} robot framework_百度搜索close browsercase2Open Browser ${URL} ${BROWSER}${title} Baidu Search seleniumshould contain ${title} selenium_百度搜索close browser*** Keywords *** Baidu Search[Arguments] ${search_key}Input text id:kw ${search_key}click button id:suEvaluate time.sleep(2) time${title} Get Title[Return] ${title}
運(yùn)行結(jié)果:
Starting test: Rf Test.Helloworld.case1 20180519 15:29:25.486 : INFO : Opening browser 'Chrome' to base url 'https://www.baidu.com'. 20180519 15:29:31.008 : INFO : Typing text 'robot framework' into text field 'id:kw'. 20180519 15:29:31.349 : INFO : Clicking button 'id:su'. 20180519 15:29:33.639 : INFO : ${title} = robot framework_百度搜索 20180519 15:29:33.641 : INFO : ${title} = robot framework_百度搜索 Ending test: Rf Test.Helloworld.case1Starting test: Rf Test.Helloworld.case2 20180519 15:29:36.811 : INFO : Opening browser 'Chrome' to base url 'https://www.baidu.com'. 20180519 15:29:42.303 : INFO : Typing text 'selenium' into text field 'id:kw'. 20180519 15:29:42.537 : INFO : Clicking button 'id:su'. 20180519 15:29:44.688 : INFO : ${title} = selenium_百度搜索 20180519 15:29:44.691 : INFO : ${title} = selenium_百度搜索 Ending test: Rf Test.Helloworld.case2
轉(zhuǎn)載于:https://www.cnblogs.com/studyddup0212/p/9060484.html
總結(jié)
以上是生活随笔為你收集整理的RF - 完整用例展示的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 铁路交通系统安全堪忧:丹麦国家铁路运营商
- 下一篇: 从JS对象开始,谈一谈“不可变数据”和函