In our current setup a video recording is started for each test case. The recording stops as the last keyword “Stop Video Recording” is called. This works as long as the test doesn’t fail mid run. Would it be possible to have the recording stop as soon as a test fails?

When you start a video recording you also set the name, save location and if it is to be embedded in the log or not. Are there any possibilities of changing these values based on if the test fails or not?
For example failed videos are to be named with _FAIL at the end and saved in another location than the ones that pass.

Not sure how to answer your 2nd question but as for your first:

Assuming you are using SeleniumLibrary you would simply change your Register Keyword to Run On Failure to the keyword(s) you want to run.

1 Like

Hi Oliver,

I would suggest you start the recording with a Test setup, and stop the recording with a Test teardown Test setup and teardown

Then regardless of the test result the recording will be stopped

If you already have atest teardown, you could add the stop recording as the last step in that test teardown.

Another option you might consider is Suite setup and teardown, but this would result in one recording for all test cases, so this might not be desiarable?

Hope that helps,


1 Like

Thank you!

Test teardowns combined with “Run Keyword if Test Failed” Worked.
I can also perform the renaming in the teardown since I know the location and name of the file with the “Move File” keyword.