Ashley
15 years agoOccasional Contributor
How do I dynamically distribute data across threads?
I’m writing a load test for an SMS gateway, the SMS’s are triggered through a http request that passes username, password, cellNumber and message as parameters. It’s a very simple system.
The object of the load test is to see whether or not the sms gateway can cope with a very large volume (1000 sms messages from unique users a minute etc). The same user can’t send multiple messages as they’re handled differently.
The username, password and phone number need to be pre-registed with the system. This is achieved for testing purposes by simply loading the details into the systems database before hand, no problem.
I have a csv file as follows:
Username1, Password1, cellNumber1
Username2, Password2, cellNumber2
...
Username999, Password999, cellNumber999
Username1000, Password999, cellNumber1000
I can load them into a testcase then iterate down the list of users perfectly fine but how do I distribute them across threads in a loadui test?
i.e. If im running 8 threads:
I’d like the 1st user to be done by the first thread then when it’s done the 9th user to be done by the first thread.
Similarly for the second thread the first user should be the 2nd user in the csv and then the second user should be the 10th user etc.
e.g.
Is there a way of doing this using groovy some how?
The object of the load test is to see whether or not the sms gateway can cope with a very large volume (1000 sms messages from unique users a minute etc). The same user can’t send multiple messages as they’re handled differently.
The username, password and phone number need to be pre-registed with the system. This is achieved for testing purposes by simply loading the details into the systems database before hand, no problem.
I have a csv file as follows:
Username1, Password1, cellNumber1
Username2, Password2, cellNumber2
...
Username999, Password999, cellNumber999
Username1000, Password999, cellNumber1000
I can load them into a testcase then iterate down the list of users perfectly fine but how do I distribute them across threads in a loadui test?
i.e. If im running 8 threads:
I’d like the 1st user to be done by the first thread then when it’s done the 9th user to be done by the first thread.
Similarly for the second thread the first user should be the 2nd user in the csv and then the second user should be the 10th user etc.
e.g.
T U1 U2 U3 U4 ...
1 1 9 17 25
2 2 10 18 26
3 3 11 19 27
4 4 12 20 28
5 5 13 21 29
6 6 14 22 30
7 7 15 23 31
8 8 16 24 32
Is there a way of doing this using groovy some how?