I need to create a random positive integer each time and send it to Json body in Gatling.
I used the below code to create a random positive ineger:
val r = new scala.util.Random;
val OrderRef = r.nextInt(Integer.MAX_VALUE);
but, How can I feed the randomly generated value into the json body?
I tried:
.exec(http("OrderCreation")
.post("/abc/orders")
.body(StringBody("""{ "orderReference": "${OrderRef}"}""").asJson)
But, this doesn't seem to work. Any clues please.
Thanks!