从CSV对每个记录进行Jmeter多次执行 [英] Jmeter multiple executions for each record from CSV

查看:211
本文介绍了从CSV对每个记录进行Jmeter多次执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有100条记录/行的CSV,我希望通过JMeter(通过服务)执行.

I have a CSV of 100 records/rows, that I wish to execute (through a service) using JMeter.

现在,我想执行每条记录3次(每次延迟5秒),然后对CSV中的所有100条记录执行相同的操作.

Now, I want to execute each record 3 times (each after a delay of say, 5 secs), and do the same for all 100 records in the CSV.

如何使用JMeter做到这一点?

How can I do so using JMeter?

推荐答案

使用jmeter的标准组件.

  1. 使用正确配置的 CSV数据集配置 ://jmeter.apache.org/usermanual/component_reference.html#While_Controller"rel =" noreferrer>同时使用控制器来读取csv文件中的所有条目.
  2. 在同一循环中,将循环控制器设置为必需的循环计数-将从每个csv条目提取的变量重复N次您的请求.
  3. 在回路控制器"下,使用合适的采样器,例如 HTTP请求采样器,以通过csv-entry发送带有参数的请求. li>
  4. 与采样器一起使用任何定时器,例如常量计时器,以在每次请求后增加延迟.
  1. Use properly configured CSV Data Set Config under While Controller to read all the entries from your csv-file.
  2. In the same cycle use Loop Controller set to required loops count - this will repeat your request N times with variables extracted from each csv-entry.
  3. Under Loop Controller use suitable sampler, e.g. HTTP Request Sampler, to send your request with params from csv-entry.
  4. Along with sampler use any timer, e.g. Constant Timer, to add delay after each request.

架构可能如下所示:


Thread Group
Number of Threads = 1   
Loop Count = 1
    . . .
    While Controller                 // this will iterate through your csv-file
    Condition = ${__javaScript("${var1}"!="",)}  // this will repeat until EOF
        CSV Data Set Config
        Filename = ...               // path to your csv file
        Variable Names = var1,...    // these are records read from file into pointed variables
        Delimiter = ,
        Recycle on EOF? = False
        Stop thread on EOF? = True
        Sharing Mode = Current thread group

        Loop Controller
        Loop Count = 3
            HTTP Request Sampler
            Constant Timer
            Thread Delay (in ms) = 5000
        . . .

这篇关于从CSV对每个记录进行Jmeter多次执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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