Renjith
Renjith

Reputation: 1154

JMeter: Share CSV records between threads

I am having a .csv file with 20 records. enter image description here

My intention is to read 5 records in a second. So all the 20 records are completed in 4 seconds. Execution must stop when all the records are read.

CSV Data Config enter image description here

Thread Group enter image description here

Sampler enter image description here

While running it is picking up only few records and each of them is shared between the threads

enter image description here

Upvotes: 0

Views: 92

Answers (1)

Dmitri T
Dmitri T

Reputation: 168197

Any reason for using log.info() and not __log() or __logn() functions?

Now serious: don't inline JMeter Functions or Variables into Groovy scripts, either use "Parameters" section or code-based equivalents instead.

As per JSR223 Sampler documentation:

When using this feature, ensure your script code does not use JMeter variables or JMeter function calls directly in script code as caching would only cache first replacement. Instead use script parameters.

enter image description here

and the same but with the code:

enter image description here

in the above example ctx stands for JMeterContext and vars is for JMeterVariables

Upvotes: 1

Related Questions