Retrieving Global Variables For Use in a Visual Test

After global variables are created in a Set global step, they are available to any visual test that executes the visual test containing the Set global step. The global variable must first be read to a local variable created in the visual test that uses the global variable, and used as a local variable.

  1. Open the visual test in which you want to use a global variable.
  2. Create the local variable into which you want the global variable value to be stored. You can create local variables in any test step.
  3. Create a step that executes the visual test where the global variable is created. Skip this step if the global variable is to be retrieved to a local variable that is defined in the same visual test. This allows the global variable to be accessed by the visual test in which you want to use the global variable.
  4. Select the step that precedes the location where you want to retrieve the global variable.
  5. Choose Insert > Global > Get Global. The Get contents of global variable step is created after the selected step. Properties for the Get contents of global variable step display in the Properties pane.
  6. In the Properties pane for the Get global step, group properties by category.
  7. Update the Assignment category properties to define the name of the global variable and any value to be assigned to it. After the properties are updated and the visual test is saved, the Get contents of global variable step appears as: Get contents of global variable '[Global variable name]' and put into local variable '[Local variable name]'
  8. Repeat steps 2 through 7 to create other global variables. After a global variable is retrieved to a local variable, the local variable contains the global variable's value. Use it in visual test expressions and in the same manner as a local variable.