I have a 2.000 line json request body. I want to use different static json files for each virtual user. I have created 10 different files of 2.000 lines each. How can I "feed" these 10 different files per user as in:
.exec(http("sendMedication")
.post("/Patient/$sendMedication")
.body(ElFileBody("magnus/SendMedication_request_2021.json"))
.check(status.is(200)))
where "SendMedication_request_2021.json" must be i.e. random or circular per user
Could I do something like:
SendMedication_request_2021(#1).json
given I have:
SendMedication_request_2021_1.json SendMedication_request_2021_2.json SendMedication_request_2021_3.json
and so forth?
You can create csv file with list of your file names and pass via Gatling EL
fileNames.csv :
fileName
SendMedication_request_2021_1.json
SendMedication_request_2021_2.json
....
And scenario:
.feed(csv("fileNames.csv").random)
.exec(http("sendMedication")
.post("/Patient/$sendMedication")
.body(ElFileBody("${fileName}"))
.check(status.is(200)))