You can define variables and use them in multiple interfaces across Continuous Testing Platform. In this section:
You can define variables in systems, environments, components, component instances, and variable sets that can be used in tests, jobs, and virtual assets. The process of defining variables in CTP is similar across all interface:
The following image example shows variables being added to a variable set associated with a TST file.
You review, add, and modify all variables related to a specific environment from the Manage Instances page in Environment Manager. Refer to Managing Component Instances for details.
All variable names are visible at the system level and shared between all environments on the same system. All variable names visible at the component level are shared between all instances of the same component.
The values defined in environment variables override the values inherited from system. Additionally, the values defined in component instance variables override the values inherited from component.
If the PATH variable is defined at the system level, for example, you can change its value–but not the variable name–when defining an environment in the system. You can also define new environment-level variables that are not present in the system. New variable names will be added to the system without values.
See #Adding Variable Sets for additional information.
Add the new value in the text field to override a value.
If you later want to remove return to the inherited variable (e.g., remove the override), click in that field, then click the Revert button in the right of that field.
When variable values are editable, you can mask or unmask them (if they were not yet saved).
In system/environment information panels, you can mask a value by clicking in that field, then clicking the Mask icon in the right of the field.
In other areas, you can mask a value by using the key icon to the right of the variable editor.
The exception is when editing variables that are inherited from SOAtest tests or within CTP (e.g., environment variables inherited from a system). These variables will inherit the parent’s masking setting. If the parent variable is masked, it cannot be unmasked at the inherited level. If you want to unmask it, you must do so at the parent level.
You can define a set of variables to be referenced within your test scenario or virtual asset. For example, you might want the WSDL, host, and port to point to different values for different test environments. When you specify these settings with variables (rather than hard-coding them in the tests), it is much easier to reuse the same test scenario across multiple environments.
One or more variables are referred to in SOAtest as an "environment" and are not to be confused with an environment as defined in Environment Manager. |
If a .tst uses variable sets, you can specify how they are set within a specific Environment Manager component instance or test job. For example, you can run a test scenario with one set of variables against a performance testing environment, then run that exact same test scenario with another set of variables against a UAT environment.
To add a variable set to an existing .tst or .pva file:
The variable sets are added to the test or virtual asset tree.
If multiple variables sets are added, a Variables folder will be automatically created to contain them.
To configure variable values, use the controls available in the Variable Set page.
If you want to mask a variable value, click the key icon to the right of the value field.
|
The active variable set is the set that tests and virtual assets can currently draw values from. The active variable set is marked with the following icon:
Open the test scenario or virtual asset page and choose a variable set from the Active variables drop-down menu.
Click on a variable set and enable the Set as active option to mark the set as active.
When you create a test job, you’ll have the option of using the variables from the active variable set or adjusting the values as needed.