Using environment variables
Once you have configured environment variables in your workspace, you can reference them in test scenarios. The below details how to reference environment variables from the scenario editor view.
There are multiple ways of referencing environment variables, depending on the custom input you are using.
Field selection (JSON Query)
You may reference an environment variable in an input field of type Field selection (JQ).
To do this, you should use the syntax:
For example, produce a JSON message value using the below example:
In the consumer task, you could create a check to validate if the
sessionId in the record equals the value specified in an equal environment variable:
Note to resolve your variable correctly, you must have an environment selected!
Template selection (Mustache)
It's also possible to access environment variables if you are using the Template (mustache) input type.
In this case, you will be provided a helper modal when clicking the '+' button.
Within this modal, select from an available list of environment variables.
To do this, you should use the below syntax: