I am wondering how to concatenate CSV feeder values to for my simulation so the url passes in multiple values instead of just one.
Below is an example csv I have from the database.
`
id
1235
111
12345
556656
444
5555
`
and in my url I am trying to get it to randomly generate different lengths eg
`
host\service\resource?id=1235&id=111&id=12345
host\service\resource?id=1235&id=111
host\service\resource?id=1235&id=111&id=12345&id=444&id=5555
`
How can I achieve this without having to change my csv?
Try using a JDBC feeder and writing a query that will return a different number of values back.
Parse the result and use it to construct the URL.
Perfectly doable if you’re a bit used to Gatling and Scala.
You’d have to loop a random number of times around the feed and programmatically accumulate each polled record into a sequence.
You can then use multivaluedQueryParam: http://gatling.io/docs/2.1.6/http/http_request.html#query-parameters
pseudo-code:
exec(function where you initialize the accumulator with an empty List)
.repeat(random number of times) {
feed(feeder)
.exec(function where you fetch form session the accumulator and the data you’ve just injected, and store back the updated accumulator)
}
exec(request with multivaluedQueryParam that takes your accumulator)
If you don’t feel like coding this, you’ll have to prepare the data upstream in your feeder.
Sweet thank you very much that is exactly what I was looking for.
Glad it helped.
Have fun!