How to make multi-lines test setup or teardown in RobotFramework without creating new keyword?

前端 未结 2 646
长发绾君心
长发绾君心 2021-02-01 07:25

I need to call two teardown keywords in test case but must not create new keyword for that. I am interesting if there is a such syntax for keywords as for documentation or loops

2条回答
  •  滥情空心
    2021-02-01 07:48

    Use the "Run Keywords" keyword.

    From doc "This keyword is mainly useful in setups and teardowns when they need to take care of multiple actions and creating a new higher level user keyword would be an overkill"

    Would look like that:

    Test Case
      [Teardown]  Run Keywords  Teardown 1  Teardown 2
    

    or also

    Test Case
      [Teardown]  Run Keywords  Teardown 1  
      ...                       Teardown 2 
    

    and with arguments

    Test Case
      [Teardown]  Run Keywords  Teardown 1  arg1  arg2
      ...         AND           Teardown 2  arg1  
    

提交回复
热议问题