Say I have a JSON request body file query.json
with the following contents:
{
"user_id": "#{userId}",
"query": "SELECT * FROM example;"
}
I am using the body in a scenario
like this:
private final ScenarioBuilder scenario =
scenario("Load test")
.exec(
http("Query")
.post("<API>")
.headers(ImmutableMap.of("content-type", "application/json"))
.body(RawFileBody("bodies/query.json")));
I now wish to use Gatling functionality to supply the user ID but keep the query constant. How should I do that? I have looked into Gatling EL and I am aware that “Only Gatling DSL methods will interpolate Gatling EL Strings. You can’t use Gatling EL in your own methods or functions.”. I was unable to extract a working example from the docs, hence my question here.