unique user data - question


I have a list of int values extracted dynamically from json body response, e.g. List {1,2,3,4,5,6,7,8,9,10}.

I need each user to pick up unique value from the list. I guess this is the case for using feeder and I wonder what is the best way of doing this through objects, without use of data files?

I am using Gatling 2.


Just so that I understand you correctly, you make one request that returns you a json body response. You want to use the content from that one response for all subsequent user simulations.

If that’s the case, then I think using two different scenarios and a custom feeder might work.

The first scenario retrieves the json body and places the content of the response into a custom feeder.

The second scenario is fed by the custom feeder.

But in order to make this work, you need to delay the start of the second scenario for however long it will take to request and parse your json content, e.g.

scen2.inject(nothingFor(10 seconds), constantRate(10 usersPerSecond) during (10 minutes))

You can read up on creating a custom feeder here: https://github.com/excilys/gatling/wiki/Feeders#wiki-custom

Hope that helps (and works!)