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?
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communityI 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?
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