How to ensure a pdf is downloaded during a loadtest?


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:

http(“S3.1 - get.php download simple”)
.formParam(“action”, “111”)
.formParam(“fileId”, “${simpleFileId}”)
.formParam(“flowId”, “${testId}”)
.formParam(“csrfId”, “${csrfId}”)

http(“S3.2 - newset.php action 308 simple”)
.formParam(“flowId”, “${testId}”)
.formParam(“action”, “308”)
.formParam(“csrfId”, “${csrfId}”)

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.