Home > Software engineering >  ROBOT FRAMEWORK: How to make test teardown execute only if test case fails?
ROBOT FRAMEWORK: How to make test teardown execute only if test case fails?

Time:02-07

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?

CodePudding user response:

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

Here is a special note about it:

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