【发布时间】:2014-01-24 18:41:21
【问题描述】:
*** Variables ***
${BROWSER} firefox
${URL} http://url/
${Delay} 0
在我的 settings.txt 文件中,我有一个名为 {BROWSER} 的变量并且关联值如上所示,它是 firefox
但我想要的是
*** 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
【问题讨论】:
标签: python selenium selenium-webdriver robotframework