Variables play a major role when scaling tests. They give flexibility to both run tests against many environments and to also manage test data. Some common uses are the base or launch url for your web application, api urls, login credentials, loop counters, etc.
When recording a new test, SnapTest will auto-create a "baseUrl" variable, after which all other actions and assertions are relative to that baseUrl. this enables you to change environments with ease.
Variables are added to test actions in the "value" or "selector" fields. They are denoted using ${ <variablename> }. All variables at this point are strings.
Variables can potentially come from six different places:
Variable values from the various sources are applied from top to bottom, overriding each other as they go. Notice that environment variables are applied next to last, so they will almost always override other variables except for component instance variables. Environment variables apply to all variables within component instances of a test.
You can combine/derive variables in environment and test/component sources.
Test default combining example:
Environment variable combining example: