Managing Global Variables
Directory Search
- Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
- Click the name of the desired PerfTest project to go to the details page.
- On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
- Select a search type. You can search for global variables by name, variable value, description, or all.
Figure 1 Search
- Enter a keyword in the search box and click the search icon on the left of the search box.
Copying a Variable
Prerequisites: You have created a variable.
- Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
- Click the name of the desired PerfTest project to go to the details page.
- On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
- You can copy variables in either of the following ways:
- Click in the operation list of the variable to be copied.
- Right-click the row where the variable to be copied is located and click Copy.
- After is displayed in the operation list, click to copy the variable to the root directory. If a variable folder has been created in the variable directory, is also displayed in the variable folder operation list. You can click to copy the variable to the variable folder.
- Click Save.
Copying a Variable Folder
Prerequisites: You have created a variable folder.
- Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
- Click the name of the desired PerfTest project to go to the details page.
- On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
- You can copy a variable folder in either of the following ways:
- Click in the operation list of the variable folder to be copied.
- Right-click the variable folder to be copied and click Copy.
- After are displayed in the operation list, click to copy the variable folder to the folder, or click to copy the variable folder to the root directory.
- Click Save.
Encrypting a Variable Value
When a global variable is of the Ciphertext type, its value must be encrypted. To change a global variable to the Ciphertext type, you need to manually update the test case that references the variable for the variable to take effect.
- Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
- Click the name of the desired PerfTest project to go to the details page.
- On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
- Create a variable or select a created variable and set its type to Ciphertext.
- Click Encrypted. In the dialog box displayed, enter the content to be encrypted and click Encrypt to generate a key.
Figure 2 Variable encryption
- Click Copy. After the message Copied to clipboard successfully is displayed, click the variable value text box and paste the generated key to the variable value.
- Click Save.
Importing Variables
- Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
- Click the name of the desired PerfTest project to go to the details page.
- On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
- Click Import. In the displayed dialog box, add the JSON file and click OK.
Exporting Variables
Prerequisites: You have created a variable.
- Log in to the CodeArts PerfTest console and choose PerfTest Projects in the left navigation pane.
- Click the name of the desired PerfTest project to go to the details page.
- On the Cases tab, select the created test case in the case list on the left, and click Global Variable.
- Click Export. The created global variables are saved to the local host in JSON format.
Inserting Global Variables
When adding request information, enter $$ in the text box to display the global variable list and click the required global variable.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot