Recently in the use of JMeter for interface testing, was a problem for a long time, is the second request how to receive the parameters of the last request response, just began to try to use the Internet generally said regular expression, long n times, did not achieve the effect I want, was the whole miserable, so, The first attempt to use the second method, which is jmeter json path Extractor, feels great, in this record
1. Download and install the Json Path Extractor plug-in and unzip it to the appropriate folder in the JMeter installation directory (not in detail here)
2. Add Request A, enter the response server, port number, path, etc. (the path to remember to lose to OH), add the HTTP header manager under a, and then add the Post processor
Because the request response results are as follows
So, write the following format in the JSON Path extractor:
AA is the default value, can be written casually
2. Add request B, add the HTTP header manager under B, because this request is a token in the request header that needs to be used in the previous request response, so in the header manager of request B, enter the
Next run a and b,b to get the token in the a request directly
Thus, the transfer of parameters between different requests is achieved.
Reference articles
Https://www.blazemeter.com/blog/advanced-usage-json-path-extractor-jmeter
Source: http://write.blog.csdn.net/postedit/71291287
JMeter JSON Path Extractor accepts the response parameters of the previous request