在机器人框架中迭代测试用例

时间:2019-05-07 10:12:56

标签: robotframework

我有一个测试用例,我必须重复测试用例的次数。有什么方法可以迭代测试用例吗?

Signin-Personal-Account
[Tags]  Tvh2
    Given Number of users signs in to their respective devices  ${xyz}
    Then xyz sees that Sign in is successful
    When xyz signs out from the device
    Then xyz sees that sign out was successful   
    And Signin is repeated for 5 times for Ellie```

测试必须重复5次。如何使测试用例重复次数?

1 个答案:

答案 0 :(得分:0)

这可以使用for循环来实现:

*** Test cases ***
Multiple sign in test
    :FOR    ${index}    IN RANGE   5
    \    Signin-Personal-Account 

*** Keywords ***
Signin-Personal-Account
    [Tags]  Tvh2
    Given Number of users signs in to their respective devices  ${xyz}
    Then xyz sees that Sign in is successful
    When xyz signs out from the device
    Then xyz sees that sign out was successful   

请确保根据您使用的机器人框架的版本-FOR loop syntax

检查FOR循环的语法