在发出HTTP请求后的Jmeter中,我有一个类似下面的JSON响应数据,我想得到所有accountId
的列表。
{"firstPage":"http://192.168.30.98/XX/v3.0/accounts?pageno=1","lastPage":"http://192.168.30.98/XX/v3.0/accounts?pageno=36","nextPage":"http://192.168.30.98/XX/v3.0/accounts?pageno=2","previousPage":null,"results":[{"accountId":220,"name":"abc2","url":"http://192.168.30.98/XX/v3.0/accounts/220"},{"accountId":1,"name":"ZZ1","url":"http://192.168.30.98/XX/v3.0/accounts/1"},{"accountId":7,"name":"ZZ2018-03-28T22:18:55.393Z","url":"http://192.168.30.98/XX/v3.0/accounts/7"},{"accountId":8,"name":"ZZ2018-03-28T22:23:11.081Z","url":"http://192.168.30.98/XX/v3.0/accounts/8"},{"accountId":9,"name":"ZZ2018-03-28T22:27:54.129Z","url":"http://192.168.30.98/XX/v3.0/accounts/9"},{"accountId":10,"name":"ZZ2018-03-....................}
我看到JSON Extractor
可以帮助我,所以我在HTTP请求后添加了它。树:
Names of created variables: = accoutnId
JSON Path expression = $..accountId
Match No: -1
compute .. = checked
当我在View Result Tree
中运行测试时,我仍然会看到上面的列表,我看不到任何内容,accountId_1
或accountId_2
。
所以我想也许是因为我没有JSON插件,我去了,Options --> Plugin Manager --> Available Plugins
然后我发现JSON plugins (deprecated)
我安装了它
重启Jmeter
重新进行测试
但我仍然没有看到JSON提取的accountIds?