How to set multi-level test setup/teardown in robot framework

强颜欢笑 提交于 2019-12-06 12:48:10

A test case can only have a single setup. When you put Test Setup in the settings for a suite as a whole, that defines a default test setup. If a child suite or an individual test defines a test setup, it will be run instead of the suite level setup defined higher up.

In the section titled Initialization files in the robot framework user guide, it says this (with emphasis added by me):

Test Setup, Test Teardown, Test Timeout

Set the default value for test setup/teardown or test timeout to all test cases this directory contains. Can be overridden on lower level. Support for defining test timeout in initialization files was added in Robot Framework 2.7.

If you want the suite to define a test setup that is run in addition to the setup specified by each test, you should put that code into a custom keyword and let each test call that keyword as part of its setup.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!