如何在robot fram中执行一个特定的测试用例n次

2024-06-16 11:05:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我有5个关于创建成员和验证工作的测试用例。我想运行这些测试用例5到20次。我的框架是robot,ide是pycharm语言python。在

APS Transformations Triggering
[Documentation] Triggering The APS Transformations for a Member
[Tags]  APSXform  APSXformTrigger  
Login to Platform Analytics
${GENERATED_MEMBER} =  Generate a Random Member  
APS_Transformations
Search for the Member
Search the Results and Go To  
Relogin If Needed
Verify Basic Member Homepage Details
Trigger APS Transformations
Save Member Details To Job Log File


APS Transformations Verification
[Documentation] Verifying The APS Transformations for a Member
[Tags]  APSXform  APSXformVerification  All
Login to Platform Analytics
Log To Console  Previous Run: ${verify_prev_run}
Fetch Previous Memeber Run Details    
Fetch URL And Go To  APP_LOGGER_URL
Log  APS Transformations are Successful.

我知道我可以为关键字执行for循环,但不想在一个关键字中编写所有这些测试用例。 -有没有git命令可以让我声明我要运行这些标记20次?在


Tags: thetologfordocumentationtags测试用例login
2条回答

有一个选项重复您的目标路径。假设要在当前路径中执行6次,则可以执行以下操作:

pybot  test "Yout test" . . . . . .

也可以将测试放入循环中:

^{pr2}$

最简单的解决方案是创建一个运行robot N次的shell脚本。可以为每个文件指定不同的输出文件,然后将所有结果合并到一个文件中。在

下面的示例将运行robot 10次,然后生成所有组合结果的日志和报告文件。在

#!/bin/bash
outputs=()
for i in {0..10}; do
    output="output-$i.xml"
    outputs+=($output)
    robot  output $output $@
done
rebot ${outputs[@]}

这样运行:

^{pr2}$

相关问题 更多 >