0

I would like to test behavior of the system for 50 users. 25 users have to do action X, with input A and 25 users have to do action Y, with input B (Users X and Y are in the CSV file). I want the top 25 users in the CSV file to do action X and the bottom 25 to do action Y.

1 Answers1

0

The best option is just adding an extra column called "action" to the CSV file so you will be able to assign the associated action to each user.


If for some reason you cannot amend the CSV file you can use a Switch Controller with the following __groovy() function as the condition:

${__groovy((new File('your_file.csv').readLines().indexOf(vars.get('your_variable_from_csv_holding_the_username')) < 25) ? 'A' : 'B',)}

And add 2 Simple Controllers named A and B as children of the Switch Controller. The "actions" are to be added to the Simple Controllers.

Small demo with the following CSV file:

user1
user2
user3
user4
user5
user6
user7
user8
user9
user10

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133