0
votes

I have large CSV file of 20000 records and i want to iterate through CSV in such a way that each thread picks up each row of CSV file. I am planning to use this for performance test for our backend API so i would appreciate if someone can tell me the correct approach of setting up threadgroup and CSV dataset config for my scenario.

line1 - ThreadGroup 1-1
line2 - ThreadGroup 1-2
line3 - ThreadGroup 1-3
so on..

After doing some reading i learned that Number of Threads = Number of rows in CSV but i don't want to hardcode Number of Threads (users).

So far this is my implementation but it is not working properly as the second row of CSV is not getting picked up by Thread Group 1-2 but instead it is getting picked by Thread Group 1-1

enter image description here

enter image description here

enter image description here

1
You have an error in log and your thread number is 1. so your question is unclear - user7294900
@user7294900 that error is due to nullpointer exception that i am getting while reading csv. My JSR223 pre-processor script remove empty parameters from request body and for some reason when i iterate to next line of csv i am getting no data which is why i am getting nullpointer. I have already raised the issue here - stackoverflow.com/questions/59060041/… - Jon Abraham

1 Answers

0
votes

Any chance that your CSV file contains commas? If yes, you will need to either set Allow quoted data to True or choose the delimiter which is not present (cannot be present) in your CSV file.

Double check the value of the variable originating from the CSV file using Debug Sampler and View Results Tree listener combination

Alternatively you can consider using __StringFromFile() function which reads next line from the given file each time it's being called