Obviously it doesn’t work as the random number is only generated once and I end up with the same number whenever this call is executed. I cant use the feeder option as my feeder is already huge and is generated by a 3rd party for each test.
Method queryParam takes Expression as both arguments, which means it can be a lambda (anonymous function):
`
def queryParam(key: Expression[String], value: Expression[Any])
`
So if you want the value to be generated every time just use a lambda instead of a fixed value:
`
.queryParam(“id”, _ => getRandomId()))
`
If you need actual session instance to generate some dynamic value you can grab it from first argument:
`
.queryParam(“id”, session => getRandomId(session)))
`
This way Gatling will know it has a function instead of value and will call it every time the step is executed