Unlike test variables, environment variables are not scoped to a specific test but are available for all the tests in an API. They allow you to create multiple environments in your test (for instance —
staging) and assign different values for variables in different environments.
To create a new environment for your test, go to the API Settings (in the top tab menu), and create a new environment in the "Test Environments" section.
Click the "+" icon to create a new environment and give it a name.
When running your test, you can select which environment to run it in using the selector in the top right corner. Select the desired environment before running the test.
After your environment is created you can add new variables in it just like you would with test variables.
Using the variables in your tests works just like using test variables. Either pass their name to assertion actions or use them in other actions with curly braces (
Updated 8 months ago