Unanswered question

Passing unique value for every user

I am using a variable extractor to get all values and want to pass unique value for every user. Example if my extractor (Date) is pulling 10 different values from the response, I want to pass the first value for first virtual user, second for the 2nd virtual user and so on.
Something like Date_Vuid1 so that it translates to Date_1, Date_Vuid2 - Date_2 etc.
Is there a way to do this?

Selifa L.
Selifa L.

Selifa L.

Level
0
27 / 100
points

Answers

Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

The issue here is that it is one single VU that is extracting all the dates, how can he then pass that to other VUs, variables are typically limited in scope to a single VU so you would need a mechanism outside Neoload, I'd suggest a database. One VU writes all the dates to a table (vu_num, vu_date), each VU can query the table and grab his date (select vu_date where vu_num = vuid). The other issue is what if there are only 20 dates but 50vu's in the test

Selifa L.
Selifa L.

Selifa L.

Level
0
27 / 100
points

My extractor returns 100+ values and test doesn't have more than 50 users so that won't be a problem. I understand that one VU will be extracting all the values but how about first VU picks first ordinal of 'date' extractor which should be date_1 and second VU picks the second ordinal etc. Want to know if this is doable?

Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

If each VU extracted all 100+ entries, then they could each pick one from the list based on their vuid. Think of an array and user #1 picks the first element, user #2 picks the second, etc. This is different than one doing the extractor and handing out values, they all get the list but just pick one entry. This is possible but you need to create the logic. Look at the java script api, I think it’s context.currentvu.id to get the vuid