Manually Adding Global Variables

Global variables can be shared between test cases. They vary from local variables, which are only available to specific test cases.

Note: You can also create global variables by clicking the Global scope option button in the Output Value Wizard.

Global variables can be used as input parameters for function calls. Global variables are configured with an initial value, which makes them useful when you need to have the same value used for multiple function calls. Each time a test run begins, global variables are initialized with the defined initial value.

To create a global variable:

  1. Click the Objects tab.
  2. Right-click an object in the Objects tree menu and choose New Global Variable. The Define a Global Variable dialog box displays.
  3. Enter a name for the variable in the Variable Name text box.
  4. Select a Variable type. The following variable types are available:
    • boolean
    • byte
    • short
    • int
    • long
    • char
    • float
    • double
    • java.lang.String
  5. Each variable has an initial value and a current value. When tests are run, all global variables are initialized to their initial values. Specify an intial value for the variable in the Initialize Value text box.
  6. Click OK.