Extract variable
Extract variables
In the Run tab (Design-first Mode) or the Request tab (Request-first mode), navigate to Post Processors.
Design-first Mode
Request-first Mode
Enter the Variable Name and choose the Variable Scope.
Select the extraction source, such as Response JSON, Response XML, or Response Text, etc.
Select the extraction source, such as Response JSON, Response XML, or Response Text, etc.
If the response is in JSON/XML format, you can utilize JSONPath/XPath syntax to parse a specific part of the Response JSON/XML and save it as the value of the variable.
After clicking "Send" to send the request, the variable extraction will be executed, and you can view the logs in the Console.
Extract variables from actual response
Extract variable
.Extract source
JSONPath extraction tool
Click on the icon located to the right of the JSONPath input box.
In the JSONPath Extraction tool that pops up, the left section displays the JSON response. You can input your JSONPath expression in the JSONPath Expression field at the top right. The results section at the bottom will dynamically extract the corresponding data based on your expression.
If your JSONPath expression includes wildcard characters (*) or similar elements that may result in extracting multiple values, the results will be enclosed within square brackets ([]). If you wish to extract a specific value and avoid the brackets, you can toggle the "Continue extracting" switch and specify the index of the value you want to extract.
Modified atΒ 2025-03-17 04:25:55