0
votes

I'm new in Jmeter and have a problem with loading user data from csv file within a thread loop.

I created a little testsuite.

  • threadgroup (Number of threads: 1, loop count 2)
    • load user data with csv data config
      csv looks like this:
      user1; password
      user2; password
      ....
    • simple http request

If I run my test I will get this output: - http request for user1 - http request for user2

I would have expected that only for user1 the request would be executed twice.
What am I doing wrong?

Regards,
Michael

2

2 Answers

1
votes

If you want to achieve the described behavior you need to:

  1. Amend your Thread Group to have 2 threads and 1 loop

    enter image description here

  2. Amend Sharing Mode of your CSV Data Set Config to be Current Thread or ${__threadNum}

    enter image description here

Demo:

enter image description here

0
votes

what do I have to do if I want to execute a request for several users? With this example I can only execute requests for the first user in my CSV file. But my csv file has several users

I will do the following test:

for every user in my csv file do a http request (as often as specified by loop count in my thread group)

Example:

CSV has 10 users
Loop Count 5
Do for every of the 10 users the http request 5 times