在Jmeter中,在发出HTTP请求之后,我有一个如下所示的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?
发布于 2018-04-13 14:17:04
这里
Names of created variables: = accoutnId可能有一些拼写错误,因为您要求的是"accountId_1 ..或accountId_2“。"accoutnId“和"accountId_1”中有拼写错误。
请参阅下面的图像


https://stackoverflow.com/questions/49807459
复制相似问题