*** Variables ***
${BROWSER} firefox
${URL} http://url/
${Delay} 0
在我settings.txt文件傳遞不同的瀏覽器我有一個名爲{}瀏覽器和準值,如圖上面的變量是火狐我們怎樣才能在一次robotframework
,但我想要的是
*** Variables ***
@{BROWSERS} firefox chrome IE
${URL} http://url/
${Delay} 0
像上面這樣的東西...所以當我運行測試套件時,它會運行在Firefox和所有測試用例完成後它將關閉Firefox,並將打開Chrome並在Chrome瀏覽器上再次運行所有測試用例。等此後它將運行在IE
那麼我們該怎麼做呢?
我不想手動做(我的意思是通過一個一個傳遞或編輯txt文件)。 全自動....一旦我運行測試,它會自動在所有瀏覽器中測試。
PS:這是在settings.txt文件中,我有兩個文件夾,其中我有test.txt文件。所以..我不得不遍歷這些文件夾在一個循環
|-- main.py
|-- settings.txt //in this file i have browser variable (or Array)
|-- test1
| |-- testl.txt
| |-- test1_settings.txt //this will contain all the variables and user defined keyword related to test1 and
|-- test2
| |-- test2.txt
| |-- test2_settings.txt //same as test1
我運行測試用例這樣 $pybot test1 test2
解決方案2應該工作,不是嗎?這就是我做這種事情的方式,我對此感到滿意。我開始與詹金斯進行測試,並且我想測試每個配置1個作業。 –