Original Address: https://www.cnblogs.com/UncleYong/p/10939647.html
A few days ago to see the group Friends of the Q group in the last 10 years of performance testing tool usage statistics, the most recent in 2018, jmeter + loadrunner accounted for 93% utilization rate, indicating that the two mainstream, which, jmeter the utilization rate increased year by year, now has more than loadrunner, accounting for 51%.
In addition to its properties, JMeter automated testing can be done, for example jmeter + ant + jenkins automated testing framework (Reference: https://www.cnblogs.com/UncleYong/p/10739519.html),jmeter interface function can also be tested Therefore, jmeter each test engineer should be an essential skill .
Here, we focus to explain the association jmeter, what is the relevance? The dynamic change variable value stored in the server, when the variable is required to automatically obtain the value of the response from the information server, and replace the latter during use. (May also be dynamically generated values the front page)
more ways jmeter association, introduces 5 ways here, there is always a way you like. If you want to know loadrunner association, can refer to the LoadRunner related articles] [Fifth: https://www.cnblogs.com/UncleYong/p/10702702.html
Back to the top of the
script ready
Here, we use dummy to simulate the sampler back to the server, access to name the value by association, then Baidu search the value of the name, which we simply simulate the dependencies between requests.
Adding dummy sampler
Set Back Content
Keyword search is a name on the value returned by request
The value of the acquired name of print
Debugging sampler
Back to the top
Method One: regular expression extractor
Regular * ?, Reference:. Https://www.cnblogs.com/UncleYong/p/10779268.html
Associated with the acquired value
Baidu search results
Back to the top
Method Two: jp @ gc - JSON Path Extractor extractor
$ interface that represents the return value, if taken in the dictionary key value, with a point, if it is to take a list of values, with the index
Associated with the acquired value
Baidu search results (omitted)
Top
Three ways: Json Extractor extractor
and a second method is similar to $ interface that represents the return value, if taken in the dictionary key value, with a point, if it is to take a value list, with an index
Associated with the acquired value
Baidu search results (omitted)
Top
Four ways: boundary extractor
that loadrunner the like and associated to the right and left boundary value, reference: https://www.cnblogs.com/UncleYong/p/10702702.html
Associated with the acquired value
Baidu search results (omitted)
Top
fashion five: beanshell post processor
writing beanshell script parsing json string.
Here to use fastjson, jar package Download: https://mvnrepository.com/artifact/com.alibaba/fastjson
After downloading, into the jar package D: \ apache-jmeter-5.1.1 lib under \ \ EXT, and then to restart jmeter
Then you can restart jmeter
fastjson parse json string
Baidu search results (omitted)
At this point, all five ways to get accurate values need to be correlated.
Make a heart-warming testing technology sharers, welcome attention to the micro-channel public number] [qzcsbj, adding dry test Q group share 652 122 175 [plus] or [168 632 201] Q number of consulting test questions. More dry, so stay tuned [ https://www.cnblogs.com/UncleYong/p/10530261.html ]