How to re-evaluate in a repeat block


I have a piece of code in my repeat block that I would like to have re-evaluated for each repeat. The construct below evaluates “nextRank” only once, then uses the very same value in each of the 100 repeats.

.repeat(100) {
exec(http(“my little test”)

.get(“blah blah blah”)
.queryParam(“myID”, propositionIDGen.nextRank)

How do I change this so I get a different rank value in each round?




session => propositionIDGen.nextRank
or _ => propositionIDGen.nextRank as you don’t use the session

Thanks, my bad, being new to both Scala and Gatling. Now using:

.exec {
session => session.setAttribute(“PropositionID”, propositionIDGen.nextRank)

And this works, thanks!