Extracting a JSON Object
Function Name
$extractingData(String json, String jsonPath, String mode)
Parameter Description
- json: Accepts a local parameter, environment parameter, or built-in function. Must be in JSON format.
- jsonPath: Accepts a string, local parameter, environment parameter, or built-in function.
- mode: Accepts jayway or fastJson.
Function Description
Extracts a JSON object from the API response for subsequent API test steps, and assigns the object value to other parameters.
Application Scenarios
This function can be used in the following parts of an API automation test case. (Do not use the function for environment parameters. Otherwise, what is input will be output.)
- Request URL
- Request header
- Request body
- Checkpoint property
- if condition
- for loop interrupt condition
Example
- Request URL
As shown in the URL request in Figure 2, the function for extracting a JSON object is used to extract the value of id returned by the body parameter (as shown in Figure 1) and assign the value to group_id.
After saving and running the script, you can view the details in the execution history.

What is your overall rating for this page?
Thank 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

