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

Plug-in Usage

After compiling the so and JSON files, upload the files to the PerfTest project and add custom requests and functions to the test cases.

Adding a Plug-in

  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 Plugin.
  4. In the displayed window, click Add Plugin. Click Select json file and Select so file. Then click Upload.

    Figure 1 Adding a plug-in
    1. The JSON file size cannot exceed 50 KB, and the file name length cannot exceed 64 characters.
    2. Restrictions on so files: The file size cannot exceed 80 MB, and the number of files cannot exceed 20.

Adding a Custom Request

Ensure that you have added the custom request plug-in.

  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 desired test case in the case list on the left.
  4. On the Case Script tab, choose Add Custom Request.
  5. In the window that is displayed, select a request.

    Figure 2 Adding a custom request

  6. Click OK.

Adding a Custom Function

After adding a custom function plug-in, enter $ in the text box and set variable type to Custom Function. Select the name of the imported function, and click Select.

Figure 3 Adding a custom function

Adding a Custom Checkpoint

Ensure that you have added the custom checkpoint plug-in.

  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 desired test case in the case list on the left.
  4. On the Case Script tab, select the request for which a custom checkpoint is to be added and click in the operation column.
  5. On the Checkpoint tab, enable result check and set the response code, header, or response content.

    When enabling the checkpoint, set at least one of the following three parameters: response code, header, and response content.

  6. Click Add Custom. In the displayed dialog box, select the imported checkpoints.

    Figure 4 Adding a custom checkpoint