jMeter循环遍历CSV中的所有值 [英] jMeter loop through all values in CSV

查看:823
本文介绍了jMeter循环遍历CSV中的所有值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用jMeter做一些测试.

I am trying to do some test with jMeter.

我有带有url的CSV文件,并且想要遍历所有URL并发出HTTP请求.通过在循环计数"字段中的ThreadGroup中输入确切的url数量,可以实现这一点.

I have CSV file with the urls and want to iterate over all of them and make HTTP Request. I have achieved that by typing exact number of urls in the ThreadGroup in Loop Count field.

是否有可能以这种方式设置jMeter而不需要在ThreadGroup中键入URL计数来循环遍历这些URL?任何控制器都可以做到这一点吗?

Is there any possibility to set jMeter in that way it will loop over the urls without the need to type count of the urls in ThreadGroup? Any controller can do this?

推荐答案

您可以使用csv数据格式定义网址,并通过它进行Jmeter循环.

You can define the urls in the csv data format and have Jmeter loop through it.

可以使用 CSV数据配置.
变量名称代表csv文件中的每一列,并且可以在循环控制器中引用.

The csv file can be defined and loaded with the CSV data config.
The variable names stand for each of the columns in the csv file, and can be referred in the loop controllers.

示例:

  1. 将条件控制器定义为${url}
  2. 定义一个子文件CSV Data Set Config,其文件路径和变量名称url代表列出URL的列.
  3. ${url}与http请求处理程序一起使用以触发该请求.
  4. 要在到达CSV文件末尾后停止执行:在CSV Data Set Config内设置Recycle on EOF? = FalseStop thread on EOF? = True.
  1. Define an while controller with the Condition as ${url}
  2. Define an child CSV Data Set Config, with the file path and the variable name url which stands for the column listing the urls.
  3. Use the ${url} with the http request handler to fire the request.
  4. To stop execution after the end of the CSV file is reached: within the CSV Data Set Config set Recycle on EOF? = False and Stop thread on EOF? = True.

这篇关于jMeter循环遍历CSV中的所有值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆