JMeter - How to run parallel execution with CSV as dataset?

994 Views Asked by At

What I am trying to accomplish => Run 50 threads in parallel using a CSV file as the dataset.

Here's how the CSV looks like (Let's say there are 50 records):

Username,Password

user1,password1

user2,password2

...,...

user50, password50

In JMeter, when I run my test case, each thread will consume 1 record of the CSV file in parallel. By that I mean, Thread 1 takes the first record (user1,password1), Thread 2 takes the second record (user2,password2), until the last record (50 in this example). And all of that happens at the same time.

I am still new to JMeter and I would like to know if this is something that is "doable" through this tool. If it is possible, your help is greatly appreciated! :)

2

There are 2 best solutions below

0
On BEST ANSWER

Given default CSV Data Set Config setup which looks like:

enter image description here

  • each thread (virtual user) will take next line of the CSV file on each loop (iteration)
  • when the last line of the CSV file will be reached it will start over from the beginning

With regards to your "at the same time" requirement - the load pattern is controlled by Thread Group settings (number of threads, loops, ramp-up period), depending on your setup you will have concurrency from 0 to 50 active users, you can observe it using i.e. Active Threads Over Time listener

If you want to send 50 requests at exactly the same moment - consider using Synchronizing Timer

1
On

This is possible using CSV Data Set Config element. It reads the data row by row and username and password can be assigned to each thread. You can use the values with following syntax

  1. Username ${Username}
  2. password ${Password}

Also please note that you do not have to define the variable names in the CSV Dataset Config Element as you have them in the first row of the CSV file.