Good day, everyone!
My goal is to make each thread user to use their own .csv file and take a different value from it each loop.
What I have is:
- A CSV Data Set Config element with path to .csv file I use to log in users (specified USER variable in CSV Data Set Config for this purpose, no password for now) containing a user1 and user2 values.
- Two one-column .csv files named user1 and user2 respectively to the names of users who use them.
- Each of this file contains a column with values user1(or user2 respectively to a file name)_test1, user1_test2 and so on.
My test looks like:
- Login
- HTTP GET request with variable from specific user's csv file (like http://google.com.${__CSVRead(path\to\file.csv,0)} )
My first failure was to use same variable I use to log in a specific user as I use in CSV Data Set Config, e. g. http://google.com.${__CSVRead(path\to\${USER}.csv,0)}. But instead of sending http://google.com.user1_test1 request, jmeter sends just http://google.com. I checked USER variable outside CSVRead function and it worked fine, so I have no idea what I did wrong in passing it to function.
When I used a static path to .csv in my request ( http://google.com.${__CSVRead(path\to\file\user1.csv,0)} ) I found that each user1 loop uses the first variable from user1.csv each time and all user2 loops use only second variable.
When I do something like:
http://google.com.${__CSVRead(path\to\file\user1.csv,0)}${__CSVRead(path\to\file\user1.csv,next)} I get:
http://google.com.user1_test2, http://google.com.user1_test4, and so on (close, but not enough ;), so may be I use "next" the wrong way)
So my questions are:
- Is there a way to pass variable to CSVReader file path?
- Is there a way to to make Jmeter to iterate through a .csv file with CSVRead function each loop instead of each thread?
Thanks for reading, I hope someone can help.