简体   繁体   English

在 Jmeter 中的每个 http 请求之后,我如何将 JsonExtractor 返回存储在数组中?

[英]how can i store the JsonExtractor return in an array after each http request in Jmeter?

I have a JsonExtractor, which takes the value returned in the "requestprotocolId", I use it in the next Thread Group because this value is passed in the next API request, but when I make 50 requests for example, it will return 50 "requestProtocolId" but they they will not return all at once, it will be one per request, so I want the value returned in this field to be stored in an array at each request, and when I finish the Thread Group and move to the next one I can use all these "requestProtocolId" in the next request, one at a time.我有一个 JsonExtractor,它取“requestprotocolId”中返回的值,我在下一个线程组中使用它,因为这个值在下一个 API 请求中传递,但是当我发出 50 个请求时,它将返回 50“requestProtocolId” " 但他们不会一次全部返回,每个请求都会返回一个,所以我希望这个字段中返回的值在每次请求时都存储在一个数组中,当我完成线程组并移动到下一个我可以在下一个请求中使用所有这些“requestProtocolId”,一次一个。 Would it be possible?这有没有可能?

  1. The next request doesn't have to necessary be in the "next Thread Group", it can be in the same Thread Group, this way you won't have to convert JMeter Variables (which are thread-local ) into JMeter Properties or use Inter-Thread Communication Plugin下一个请求不必在“下一个线程组”中,它可以在同一个线程组中,这样您就不必将 JMeter 变量线程本地)转换为 JMeter 属性或使用线程间通信插件

  2. If you want to collect 50 "requestprotocolId"s from 50 separate requests into some form of array - it can be done using JSR223 PostProcessor , take a look at the following materials:如果您想从 50 个单独的请求中收集 50 个“requestprotocolId”到某种形式的数组中 - 可以使用JSR223 PostProcessor来完成,请查看以下材料:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM