Updated on 2024-06-06 GMT+08:00

Creating and Deleting Global Variables

The global variables of scalable test projects are organized and managed in directories.

Creating a Variable

  1. Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
  2. Click the name of the desired PerfTest project to go to the details page.
  3. On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
  4. You can create a variable in any of the following ways:

    • Click New Variable.
    • Right-click the blank area under the No. row and click New Variable from the displayed list.
    • If a variable or variable folder exists, click in the operation list where the variable or variable folder is located.

  5. Set parameters by referring to Table 1.

    Table 1 Setting global variables

    Parameter

    Description

    Name

    Name of a new global variable.

    Type

    The variable types such as String, Integer, Long, Double, Ciphertext, BigDecimal and Boolean are supported.

    Value

    When a pressure test task is running, the parameter values of the corresponding global variables are read.

    If the variable value is too long, click on the right of the text box, and enter a value on the displayed page. Press Enter to increase the number of lines of the input value. After the input is complete, click Backfilling. If the input content is in JSON format, you can click JSON Conversion to view the input value.

    Description

    Description of the new variable.

  6. Click Save.

Creating a Variable Folder

  1. Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
  2. Click the name of the desired PerfTest project to go to the details page.
  3. On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
  4. You can create a variable folder in any of the following ways:

    • Click the drop-down button on the right of New Variable and click New Folder.
      Figure 1 Creating a Folder
    • Right-click the blank area under the No. row and click New Folder from the displayed list.
    • If a variable or variable folder exists, click in the operation list where the variable or variable folder is located.

  5. Enter the folder name and click Save.

After a folder is created, you can create subfolders and subvariables in the folder. You can create subfolders and subvariables in either of the following ways:

  • Click the icon for creating a subfolder or subvariable in the folder operation list.
  • Right-click the row where the folder is located and choose New Subfolder or New Subvariable.

Deleting Variables and Variable Folders

Prerequisites: You have created variables and variable folders.

  1. Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
  2. Click the name of the desired PerfTest project to go to the details page.
  3. On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
  4. You can delete a variable or variable folder in either of the following ways:

    • Click in the operation list of the variable or variable folder to be deleted.
    • Right-click the row where the variable or variable folder to be deleted is located and click Delete.

  5. Click Save.

To delete all variables and variable folders, choose More > Remove All . In the displayed dialog box, click OK.

Figure 2 Remove All