restjmeterjmeter-pluginsjmeter-5.0

Jmeter select random value from CSV data


I have a CSV file contains of userId If I tried to use CSV Data Set Config its reading from top to bottom until the last value. But example I want to simulate random userId from the list of CSV file how can I simulate this? I don't want to fix my userId I want random userId from CSV file. I tried to avoid to use user defined variables because I have more than 50k user_id and based from my machine specs it's unable to handle the load that's why I'm planning to migrate to CSV file.

Current Behavior if I used ${userId} on my Jmeter:

123
321
55
11
22
33
44
55
66
77
88
99
39
111

Here's my CSV File:

enter image description here

Jmeter File

enter image description here


Solution

  • If you don't mind using JMeter Plugins there is Random CSV Data Set Config which provides "Random mode"

    enter image description here

    Alternative options are:

    1. HTTP Simple Table Server which provides RANDOM mode of reading
    2. You can shuffle the file beforehand somewhere in setUp Thread Group using JSR223 Sampler and Groovy language