Environment Variables
Environments are accessible throughout an entire API Project, so environment variables, unlike test variables, can be used in multiple API tests.
Environment variables are only accessible when executing a test on their housed environment. For example, this allows a user to have a development and a staging environment that both have an environment variable of userToken
but use a different value for userToken in each environment.
There are two types of environment variables:
-
[Secret]: Secrets are key-value pairs that save sensitive data. The value field for secrets is obfuscated, so it is not visible to users.
-
[Variable] Variables are key-value pairs where the value is not obfuscated.
Secret
To create a new environment secret, head to the Testing Settings tab. Create a secret by clicking the key icon in the environment you want to make the secret in.
Enter the secret Key and Secret, then click the green check to save.
Variable
To create a new environment variable, head to the Testing Settings tab. Create a variable by clicking the + in the environment you want to make the variable in.
Enter the variable Key and Value, then click the green check to save.
Updated almost 2 years ago