通过使用脚本在 Python 中对多测试套件使用 --rerunfailed 来启动机器人框架

问题描述

我正在使用 executor.py 来运行机器人框架文件。 我调用 CLI:

cmd = 'start /wait cmd /c "robot -d %s -o original.xml %s -A %s "' %(results_dir,tag_command,argument_file)

with argument_file 是包含所有测试套件的 *.txt 路径:

..\tests\Login.robot
..\tests\Add_to_bag.robot
..\tests\Checkout.robot

然后我调用 CLI 重新运行测试失败:

rerun = 'start /wait cmd /c "robot --rerunFailed %s\\original.xml -o rerun.xml %s-A %s"' %(results_dir,argument_file)

我有添加错误

Suite "Login & Add_to_bag & Checkout" contains no tests matching tag "Failed" and matching name "Checkout.Checkout.Test case 1: Failed" or "Checkout.checkout.Test case 3: Failed" 

我在 checkout.robot 测试套件中编写了 3 个示例测试用例

Test case 1: Failed
    [Tags]    Failed
    Fail
Test case 2: pass
    [Tags]    Failed
    Log    'Pass'
Test case 3: Failed
    [Tags]    Failed
    Fail

有人对这种情况有什么想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)