Jmeter multiple executions for each record from CSV

拜拜、爱过 提交于 2021-01-27 21:42:51

问题


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

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.

How can I do so using JMeter?


回答1:


This doesn't look to be hard implemented using jmeter's standard components.

  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.

Schema may look like:

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
        . . .


来源:https://stackoverflow.com/questions/12294680/jmeter-multiple-executions-for-each-record-from-csv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!