1

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

1 Answer 1

2

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
    Fail

Your Answer

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

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