简体   繁体   English

我如何基于从json路径提取器提取的值传递n个请求

[英]How can i pass 'n' number of requests based on value extracted from json path extractor

In Jmeter, I have extracted a value from json. 在Jmeter中,我从json中提取了一个值。 The value is 2. My requirement is I need to send following HTTP samplers. 值是2。我的要求是我需要发送以下HTTP采样器。 Here it is 2. So I need to send the following 2 http requests. 这里是2。所以我需要发送以下2个http请求。 http://IP:PORT/users/0?authSSOId http://IP:PORT/users/1?authSSOId http:// IP:PORT / users / 0?authSSOId http:// IP:PORT / users / 1?authSSOId

If its 'n' request I need to pass upto 'n' counts in the url How can i Achieve this 如果它的“ n”个请求,我需要在网址中最多传递“ n”个计数,我该如何实现

You can add loop controller which will execute HTTP request as per your extracted count. 您可以添加循环控制器,该控制器将根据您提取的计数执行HTTP请求。 Structure will look like below: 结构如下所示: 在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

Given you have this 2 living in a JMeter Variable, ie ${valueFromJson} 假设您有2居住在JMeter变量中,即${valueFromJson}

  1. Add While Controller to your Test Plan and put the following expression into the "Condition" input: While Controller添加到您的测试计划中,并将以下表达式放入“条件”输入中:

     ${__javaScript(${counter} < ${valueFromJson},)} 
  2. Put a Counter as a child of the While Controller and configure it like: 计数器作为While控制器的子级,并按以下方式进行配置:

    • Start: 1 开始: 1
    • Increment: 1 增量: 1
    • Reference Name: counter 参考名称: counter
  3. Put your HTTP Request sampler after the Counter 将您的HTTP请求采样器放在计数器后面

The HTTP Request will be executed as many times as the ${valueFromJson} variable value HTTP请求将与${valueFromJson}变量值一样执行多次。

JMeter While Controller计数器

暂无
暂无

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

相关问题 Jmeter json路径提取器 - 如何从提取的值中删除[] - Jmeter json path extractor - How to Remove [ ] from extracted value 试图将值(从 json 路径提取器中提取)传递给下一个 http 请求 - trying to pass the value (which is extracted from json path extractor) to the next http request 如何根据条件从 JSON 路径提取器中提取值 - How to extract value from JSON Path extractor based on condition 将 Jmeter 中的 json 提取器中提取的字符串拆分为 n 组 - Split the String extracted from json extractor in Jmeter with sets of n 如何将在JSON路径提取器中提取的变量用于场景的进一步步骤? - How to use variable extracted in JSON path extractor for further steps of scenario? 如何使用JSON Extractor提取的多个值中的每个请求使用一个值 - How to use one value per request from the Multiple Values extracted using JSON Extractor Jmeter:我正在使用 Json 提取器从 Json 响应中传递值,但我没有在调试采样器中看到该值 - Jmeter : I am using Json extractor to pass value from the Json response but I am not seeing the value in the debug sampler 如何使用JSON路径提取器为2个条件选择相同的值 - How to use JSON path extractor to pick the same value for 2 condition 使用Beanshell后处理器修改从JSON提取器提取的数据 - Using Beanshell Postprocessor to modify the data extracted from JSON extractor 无法使用JSON提取器或jp @ gc-JSON路径声明来确认响应中的值 - Can't use JSON Extractor or jp@gc - JSON Path Assertion to confirm a value in a response
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM