Variables
Use of variables and predefined variable sets
In most case we do not want to hard code values in our test and we want to control the value based on certain environment to run it. You can specify predefined variable set using a JSON file.
Predefined Staging Environment Variables features/data/uat.variables.json
For example above is our variable set, and we have 2 key-value that we can use within our test. Using the above anticipated variables, the following can be our test:
In the above example, we can use the variable by using curly braces to enclose our variable name, such as {host}. In the example above, we used the variable as our source for the host, and we also used another variable in the username as part of the body.
Specifying predefined variable in runtime
Last updated