3
votes

My scenario is like, 1. Login by multiple users (100 users) 2. Select 50 items by id's specific to user

I have placed id's for each user in separate csv file say user1.csv, user2.csv, user3.csv and so on.

My result should be like Thread 1 should take user1.csv and process all 50 id's in loop controller. Thread 2 should take user2.csv and so on.

I tried with below example, but still couldn't find the solution.

Eg. I used file path as C:\abc\user${_threadNum}.csv

Or

C:\abc\user${_threadNum}.csv

Variable name in csv file is user_id

Requeat will look like /home/abc/${user_id}

I want thread 1 to use the user1.csv file and substitiue the value of user_id in the request and thread 2 should use user2.csv and so on.

If I execute my above plan, I am getting error as /home/abc/EOF

How is this possible in JMeter? Or any other approach?

Please provide solution with an example, since I am new to JMeter.

3
I am also getting the same EOF as data from CSV for all columns. How to step further ? can anybody please help.Virendra Joshi

3 Answers

2
votes

Create your files like comman_name_1,comman_name_2,comman_name_3 etc. & select current thread option from dropdown list present in csv data config set.This will allow threads to use different files per thread or put values in a single file and select current thread option.

0
votes

It's easy, just add CSV Data Set Config to each thread (user1.csv for thread1 and so forth). Configure CSV Data Set config, and select one of this values in Sharing mode field:

  • Current thread group - each file is opened once for each thread group in which the element appears
  • Current thread - each file is opened separately for each thread

UPD: I have done it right now, it works

Script looks like this:

CSVExample

I selected 'Current thread' in each CSV Data Set Config

0
votes

I was making the mistake of using single underscore in fetching the count of thread. We need to use double - underscore like this : ${__threadNum} Note :