The contribution to the variable stack happens in this order:
- Global Vault
- Project Vault
- Test’s global variables
- Test’s input set variables
- Selected environment variables (also referred to as “Overrides”)
- SET components within the test
Global Vault
Project Vault
Test Global
Test Input Set
For example, if you’re testing the /api/product/:id API, the ID is specific to a scenario, so that should be a variable in the input set. The ability to have multiple input sets in a set allows you to run a test against multiple scenarios.
Environment / Overrides
For example if, as a default, the domain variable reflects a production environment, but you occasionally want to run the test against a staging environment, this is where you redefine the variable. Being “environment” the last step prior to test execution, it will win over the default.
Note: as a general rule of thumb, we strongly advocate for not relying on environments for the test to function properly. Tests should be self-sufficient and already be able to run before the environment stage, which should be used to change the value to certain variables, not defining new ones.