I have created a suffix for any test data I use in my test cases, for instance when adding an account you must enter a name for it, I use the static text "test" and then add the suffix to the end of this, this is what I do for all fields.
However, I need to check that this data has been saved correctly and is displayed correctly during these test cases so I need to somehow make Robot Framework remember this suffix I've generated. So far in my test cases I've just been using set variable
after generating the data with faker, but obviously this is contained within the keyword, how could I make it so that this generated data is accessible for the duration of my testing session (until all tests, in the folder are finished)?
My code at the minute:
*** Test Cases ***
Valid Login
Open Browser To Login Page
${num}= Random Int
${suffix}= set variable ${num}
Input Text username ${suffix}
To reiterate, I then want to check this ${suffix} value in another test case
Thanks in advance!
Edit:
Test suite file
*** Test Cases ***
Valid Login
Open Browser To Login Page
Fill field a11y-username ${MYNUM}
Resource file
*** Variables ***
${MYNUM}
*** Keywords ***
Suite Setup
${MYNUM}= Random Int
Set Suite Variable ${MYNUM}