Environment variables in useMango™️ serve as project wide entities that can be used in tests. These are different from Project data variables in useMango™️ in the sense Project data variables have a fixed value while environment variable values are defined by the chosen environment.
To view all environment variables in a project, we click on the Data tab in useMango™ and then on the Environment tab in it.
Create a Environment Variable
To create an environment variable:
Click on Data tab in useMango™ and then on the Environment tab in it to open the Environment Variables page.
In the top-right corner of the Environments tab, click on the text box and enter your variable name.
Click on the Add data button to create a new Text type variable. Click on the arrow next to the Add data button to create a variable of any other type.
Choose the type of the project variable - Text, Secret, Web identifier, Mobile identifier or Image identifier.
Delete an environment variable
To delete an environment variable
Click on the checkbox next to the environment variable.
Click on the Delete button in the bottom-right area of the Environment tab.
Click on Delete button again on the popup appearing to complete the process.
If the environment variable is used in anywhere, a dialog box is shown to confirm the removal of references of it. Confirm the deletion by clicking on the Ok button.
Rename an environment variable
To rename an environment variable:
Click on the name of the environment, the name is now editable.
Enter the new name of the environment variable.
Press Tab to save the new name.
Using environment variables in tests
To use an environment variable as a step parameter of a test or a composite component:
Click on the step parameter where you want to use the environment variable; a list of environment variables and data variables are shown.
Select the environment variable from the list or start typing in the variable name to search for it.
Click on the environment variable (Environment variables are Indigo colored) to set it as the step argument.
Some notes about environment variables:
Environment variables namespace is shared with data variables. So, if you have a data variable with the same name as an environment variable, you will not be able to rename the environment variable to the same name as the data variable.
Environment variables are read only when used in tests, hence they cannot be modified by the test while it is executed.