根据机器人文档
Variables set in the command line have the highest priority of all
variables that can be set before the actual test execution starts.
They override possible variables created in Variable tables in test
case files, as well as in resource and variable files imported in the
test data
我已经在关键字A中定义了套件级别的变量浏览器,并在套件设置中调用了该关键字
Log Browser is ${browser} console=True
Set Suite Variable ${browser} chrome
Log Browser is ${browser} console=True
并且还使用命令行传递相同的变量–variable
pybot.bat-变量浏览器:ie
但是从日志来看,Suite Variable似乎覆盖了命令行变量.
解决方法:
您引用的文档说明了一切(我已经强调了):
Variables set in the command line have the highest priority of all variables that can be set before the actual test execution starts
测试开始后,关键字可以覆盖变量表和命令行参数设置的值.