I have a doubtful pleasure to work with legacy tests written in Robot Framework that abuse usage of global variables.

I would like all global variables to be dumped when the test fails.

How can I achieve that?


1 Answer 1


You can call the built-in keyword Log Variables in a suite teardown or test teardown.

Here's an example that uses a suite teardown:

*** Settings ***
Suite Teardown   log variables

*** Test cases ***
Test case 1
    set global variable  ${FOO}  Hello
    set global variable  ${BAR}  World

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.