Sometimes you have pieces of information that you want to use in multiple tests that might change in different runs. For example, a link to the testing environment for a specific run, login information for a test user, or a Google Form that changes for each run. If you’re including that information in multiple tests, it can be painful to update it everywhere. And doing it manually creates the risk that you leave the wrong information some place.
Instead, use variables to change data in one place and have it update in multiple tests. Then when your testing environment URL changes between runs, you can just update the variable and all your tests will have the right information.
If the content is entire steps, see how to reuse steps across tests.
In the Testlio platform, open the workspace where you want to reuse content.
Click Settings.
Expand the Tests category and click Variables.
Click + New variable.
Give it a unique name to remember (such as
test_environment).Enter the value (such as the testing environment URL).
Click Create variable.
In the top menu, click Tests.
Open a test where you want to use the variable.
For the step where you want to reuse the content, enter the variable name inside three curly brackets (
{}, so{{{test_environment}}}in the example).
Now when you click away from that test step, you see the value you entered for the variable instead of its name.
Limitations
Historical data is not stored. So once you change a variable, all record of what it was before is gone. So be careful before you change the name or value.
