In the test creation process, the definition of global and local variables allows you to parametrize the test to allow more flexibility.
The global parameters are common variables designed to run with the whole test (i.e. api key, domain etc).
For adding a global parameter/varaible click on the +Add Global Param in the Data Sets panel:
Then fill in the name and value:
The parameter/variable will be present in the test scope, and remains constant during test execution.
The input set, instead, is a group of input variables representing a scenario (i.e product id).
To add in input set, click the + button in the Input Set section
Then add a name for the set. Then click + Add Param and add the variable name and value.
The unit executes once for each input set you define. At each iteration, one input set enters the scope.
If you define a variable in both the Global Parameters section, and in the Input Set section, the value used in the test will be the one defined in the Input Set.
The priority order is:
- if the same variable is defined in the Vault and in the composer, the one defined in the composer will be used.
it also doesn't matter if it is a global parameter, or an input set
- if the same variable is defined in the composer both as a global param and an input set, the value of the input set will be used
- if the same variable is defined in the Vault (or in the composer) and in the scheduler, the variable defined in the scheduler will be used for the tests.