Search code examples
jmeterjmeter-5.0jmeter-4.0

read 2 files in csv jmeter


I want to read 2 csv's file. One file is for the users and other is for the products. Once login ,I need to loop the products(from csv)and submit the requests. After that second user with the same the loop .

Created CSV data config and added the users.csv Added loop controller (lo0p 3 times) Added http request pass the user details to the url.saved the auth key in token parameter Another CSV data config added to read products.csv Added http request and add product as parameter.

Given ThreadGroup threads as 3(no of users).

But the order is not as expected. 1st user is picking the 2 products and 2rd user picking the third product again 1st user picking the first product. enter image description here

I need user has to pick all the products.

Any suggestions?


Solution

  • I don't think we'll be able to help without seeing at least first several lines of both CSV files and configuration of your CSV Data Set Config.

    I cannot reproduce your issue according to the description:

    enter image description here

    So cross check your setup with CSV Data Set Config documentation. Additionally you might want to use Debug Sampler and View Results Tree listener combination in order to see JMeter Variables from the CSV files with their respective values, it might be the case that due to concurrency the order of users might not be very sequential, in this case you will need to change "Sharing Mode" of the "products" CSV Data Set Config to Current thread

    enter image description here