简体   繁体   English

试图将值(从 json 路径提取器中提取)传递给下一个 http 请求

[英]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.

相关问题 我如何基于从json路径提取器提取的值传递n个请求 - How can i pass 'n' number of requests based on value extracted from json path extractor Jmeter json路径提取器 - 如何从提取的值中删除[] - Jmeter json path extractor - How to Remove [ ] from extracted value 如何使用JSON Extractor提取的多个值中的每个请求使用一个值 - How to use one value per request from the Multiple Values extracted using JSON Extractor 如何将在JSON路径提取器中提取的变量用于场景的进一步步骤? - How to use variable extracted in JSON path extractor for further steps of scenario? 如何根据条件从 JSON 路径提取器中提取值 - How to extract value from JSON Path extractor based on condition JSON提取器使HTTP请求停止 - Json extractor make HTTP request stop 将 Jmeter 中的 json 提取器中提取的字符串拆分为 n 组 - Split the String extracted from json extractor in Jmeter with sets of n Jmeter 组合 Json 提取器变量以传递给请求 - Jmeter combine Json extractor variables to pass into request 使用Beanshell后处理器修改从JSON提取器提取的数据 - Using Beanshell Postprocessor to modify the data extracted from JSON extractor 在循环之外的Jmeter中,依次将JSON提取器Ref名称传递给另一个请求 - Pass the JSON extractor Ref name to another request sequentailly in Jmeter which is outside the loop
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM