Once the interface is returned in JSON format, it is possible to use JSON extractor to fetch the returned value for correlation or assertion.
1, first, to V2ex to find an interface, the address is: https://www.v2ex.com/p/7v9TEc53
Interface with an up-to-date topic:
Https://www.v2ex.com/api/topics/latest.json
- Method:get
- Authentication:none (No authentication)
The format returned by this interface is in JSON format and can be viewed directly by opening the browser
2, JMeter new interface, after running in the view of the number of results can see the latest topic content
3. New JSON Extractor
An expression about JSON path can be seen here, very detailed: http://goessner.net/articles/JsonPath/
The $ representation is followed by the node;
[] represents an array, 0 means the first; $[0] represents the first object after the node
ID is key, here to get the value of the ID, so fill in the ID
4, run, view the results
Take a look at the value of the first ID crawled by JSON extractor
After grabbing it, you can make assertions, correlate them with
Vi. JMeter Post processor JSON Extractor