Search code examples
scalagatling

Timestamping in a post request body in Gatling Simulation


The JSON body of the post request consists of a time parameter that needs to get changed wrt time.

How can I define an attribute for the same so that I can call it like this in the request body,

"time": "${timestamp}"

Thanks for the help.


Solution

  • There's a built-in Expression Language function currentTimeMillis(), see doc.