简体   繁体   中英

ROBOT FRAMEWORK: How to make test teardown execute only if test case fails?

I could use the "TEST TEARDOWN" keyword in the header but this gets executed after each test case. Is there any way I can do in the code so that it only executes if the test case fails and if otherwise, skips?

"

The keyword Run Keyword If Test Failed<\/a> was created for that case. Better have Robotframework documentation always at hand (and browse trough it at least once).

This keyword can only be used in a test teardown. Trying to use it anywhere else results in an error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM