Test environments
You can define custom environments to manage sets of variables such as application URLs and user credentials, and to configure profile overrides. When you run a test, the variables and override rules defined in the environment dynamically replace the values within your test script. You can easily change testing targets without modifying your test script by using environments because the environment-level configurations take precedence over the default values defined in the script.
You can create, edit, copy, move, and delete the environments. When you create an environment, a .dte.yaml file is created and listed under the Environments folder for the selected application in the test navigator panel.
Environments that you defined for an application are available for selection in the
Environment drop-down list in the header of the
Test Editor page. If no environments are defined in the
selected project, the Environment list displays No
environments available. The last environment selected by a user is
retained as the pre-selected option in the list. This selection is used for authoring
and execution flows unless you explicitly select a different environment. When you open
a test that is associated with a different application, then the
Alert icon
is displayed in the Environment box indicating that the
selected environment is not associated with the current asset's application or any of
its dependent applications. You can select or unselect an environment from the list.
Environments that you defined for an application are also available for selection in the ENVIRONMENT tab of the Execute test asset dialog when you initiate a test run.
- Value: Stores the alphanumeric value that you enter as the variable
value. The text is used as-is. For example, if you enter
1 + 2, the value of the variable is the string1 + 2. The promoted variable as a value is listed on the environment page and you can manage the value from this page. - Code: Evaluates the value as an inline JavaScript expression when the
variable is referenced, and uses the result as the variable value. For example,
enter
700 + Math.floor(Math.random() * 201)to generate a random integer from 700 through 900. The variable uses the resulting number, not the JavaScript expression itself. You can also use this type for generated values such as ticket IDs or credit card numbers that follow a pattern. - Secret: Stores sensitive data, such as passwords, authentication tokens, or credit card numbers. Secret values are managed thorough security groups and they are masked on the Security page. The promoted variable as a secret is listed on the environment page and the value of the secret is not displayed.
Profile overrides
In addition to managing variables, you can use environments to configure profile overrides. By using profile overrides, you can substitute a default profile, such as a specific browser or emulated device, with a different target profile, such as a cloud-native device or alternative browser, when you run tests.
In the Execute test asset dialog, you can either specify an Environment that carries override rules or select a browser or device profile in the Browser field. If you specify values in both the Environment and Browser fields, then the value in the Browser field takes priority.