[英]trying to pass the value (which is extracted from json path extractor) to the next http request
I have extracted 10 values from a Json path extractor, naming device_1,device_2,device_3 to device_10.我从 Json 路径提取器中提取了 10 个值,将 device_1、device_2、device_3 命名为 device_10。 I am able to see these 10 values in debug sampler and now i want to pass on these value to the next http request one by one (may be by using a loop) but i am not able to find any way where i can pass all these 10 values one by one to next http request.
我能够在调试采样器中看到这 10 个值,现在我想将这些值一个一个地传递给下一个 http 请求(可能是通过使用循环),但我找不到任何可以传递所有值的方法这 10 个值一一对应下一个 http 请求。 As of now i am sending only 1st value as ${device_1} in the http request but i want 10 different users to access all 10 values one by one.
截至目前,我在 http 请求中仅发送第一个值作为 ${device_1},但我希望 10 个不同的用户一个一个地访问所有 10 个值。
I believe ForEach Controller is something you're looking for.我相信ForEach Controller是您正在寻找的东西。
Configure it like:像这样配置它:
and use ${device}
in the HTTP Request sampler which is inside the ForEach Controller .并在ForEach Controller内的HTTP 请求采样器中使用
${device}
。
The HTTP Request will be executed as many times as there are matches generated by the JSON Extractor. HTTP 请求的执行次数与 JSON 提取器生成的匹配次数一样多。
The similar concept is described in Using Regular Expressions in JMeter article 在 JMeter 文章中使用正则表达式中描述了类似的概念
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.