问题
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.
- Use properly configured CSV Data Set Config under While Controller to read all the entries from your csv-file.
- 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.
- Under Loop Controller use suitable sampler, e.g. HTTP Request Sampler, to send your request with params from csv-entry.
- 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