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

Adding a Global Variable of the Integer, Text, or Enumerated Type

Procedure

  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, click Global Variables.
  4. Add a global variable manually.

    1. Click Add Variable.
    2. Set parameters by referring to Table 1.
      Table 1 Setting global variables

      Parameter

      Description

      Name

      Name of a new global variable.

      Type

      Variable type, which can be integer, text, or enumerated.

      Value

      A pressure test task reads the value range of the corresponding global variable when it is running. For each virtual user, the variable value is polled. That is, the first virtual user obtains the first value of the variable, and the second virtual user obtains the second value. If the values are exhausted, the next virtual user obtains the first value again.

      NOTE:

      Variable content is transmitted in plain text during the pressure test. Exercise caution when entering the content.

      • When the variable type is Integer, enter the value range of the variable.
      • When the variable type is Enumerated, click to enter a variable value.
      • When the variable type is Text, enter a text value.

      Read Mode

      Sequential Mode: Variables are read in sequence.

      Random Mode: Variables are read randomly.

      Sharing Mode

      Case: All concurrent requests share a variable.

      Concurrency: Each request copies a variable with the same name for use. Different concurrent requests read the variable values in sequence and do not affect each other.

      Sensitive

      If this option is selected, the variable value is encrypted for storage. Editing the variable after the page is refreshed will clear the variable value. Please exercise caution.

      NOTE:

      Sensitive parameters apply only to text variables.

      For details about the variable read rules for different variable read and sharing modes, see Variable Read Rules.

    3. When the settings are complete, click to save them.
    4. After creating a variable, you can perform the following operations:
      • Click Edit to modify it. If the global variable is referenced by a transaction, the value of the global variable in the transaction will be changed synchronously after the modification.
      • Click Delete to delete the added global variable file.

        The global variable file cannot be deleted when it is referenced.