0
votes

In Jmeter, I have a test plan consisting of 2 Thread Groups(each having a single http request) which need to be executed in parallel. Thread Group 2 requests depend upon the response data values from the request performed in Thread Group 1.

In Thread Group 1, I am writing to a csv file using beanshell postprocessor. This data from csv file needs to be used in Thread group 2. I have written csv data set config for the same and it's working fine.

Now, my requirement is: as and when the above csv file is written for a value through Thread Group 1, the Thread Group 2 request should read it and use the data.

This is to achieve a scanario wherein there are multiple users, and suppose, user 1 and user 2 have the values in csv file through Thread Group 1, so, they can invoke Thread group 2 request based upon the csv file value. At the same time, user 3 is trying to invoke the request from Thread Group 1 and writing the value to csv file.

Also, I need to make sure that there is atleast one value in the csv for Thread group 2 to proceed ahead. And there should not be duplicate reading of the csv values

How can I achieve this?

1

1 Answers

0
votes

I would double check if you REALLY need two thread groups: check if you can put the two users in the same thread group: then the second one will receive the data from the first one using variable. There are drawbacks, but it is quite simple to write and debug.

If you really need to decouple the first and second group of operation IMHO, the csv file I/O will have concurrency problem. I think you should use a queue, for example a REDIS DB can be an effective solutions.

Have a look to jmeter-plugins.org.