Use CSV feeder to load data but random value per request

Hi

I am happily using Gatling 2.2.2

I would like to use a CSV feeder to load some data, but to retrieve random values in the url per request. Is this possible? It seems that the FeederBuilder takes an implicit ScenarioContext.

I’d like to be able to do something like:

val idFeeder = csv(“file.csv”).random.records.iterator

And then inside the Scenario:

.get(session =>
val id = idFeeder.next()(“id”)
“/url/” + id
)

Am I making sense?

When I try the above, I sometimes get errors.

Hi Greg,

I found I was getting errors consistently due to the csv file ending with an extra newline. Maybe your random selection errors due to selecting the blank end line?

Kind regards,
Tony.