Reputation: 503
I am trying to simulate file download scenario for API Testing using jmeter.
When the downloaded files are being saved, all the files are getting saved in PDF format only even though some files are of different format.
The API for download is of GET type and I am using "Save Responses to a File" listener with only a Filename Prefix value, any other checkbox or textbox I have kept empty.
Is there anything in jmeter from which file download format is decided? If yes then please let me know.
Upvotes: 0
Views: 323
Reputation: 168072
Looking into Save Responses to a File source:
String fileName = makeFileName(s.getContentType(), getSkipAutoNumber(), getSkipSuffix());
^^^^^^^^^^^^^^^^^^
where s.getContentType()
is basically SampleResult.getContentType() which in its turn gets the file extension from the Content-Type header returned by your server.
So if your server responds with Content Type == application/pdf - JMeter will "trust" the server and store the response as .pdf
.
You can check the actual value of the Content-Type
header using View Results Tree listener:
Upvotes: 1