How to ensure a pdf is downloaded during a loadtest?

Hi,

I have a script where two requests are triggered when I mimic click on a download button. Manually if I do it in UI it works fine and the file is downloaded into my local. However, if
I try the same via script gatling shows everything works fine but the file is not present in my local.

The two requests are as follows:

exec(
http(“S3.1 - get.php download simple”)
.post("/participant/controller/flow/get.php")
.formParam(“action”, “111”)
.formParam(“fileId”, “${simpleFileId}”)
.formParam(“containerId”,"${simpleContainerId}")
.formParam(“flowId”, “${testId}”)
.formParam(“csrfId”, “${csrfId}”)
.check(
status.is(200)))

.exec(
http(“S3.2 - newset.php action 308 simple”)
.post("/participant/controller/flow/newset.php")
.formParam(“flowId”, “${testId}”)
.formParam(“action”, “308”)
.formParam(“value[userid]”,"${testInf.userId}")
.formParam(“csrfId”, “${csrfId}”)
.check(
status.is(200)
))

I did some reading related to other performance tools and it suggests setting response headers content-disposition: attachment or content-type: pdf/application. However, in the application Is there a way by which I can save the response header and change it so that the file will get downloaded? For the new header do I need to send a fresh request?
Thanks in advance

Hi Reetu,

How did you achieve this? I have a same scenario. If someone can post solution that would be more helpfull.

Thanks.