API downloading CSV File thru Jmeter shows different File Size & content

59 views Asked by At

Hi can someone help me check why I'm getting different CSV file content upon downloading thru Jmeter? Your response is highly appreciated. Thank you so much in advance.

Sample Download thru Manual click

enter image description here

File Format & Size

enter image description here

Fiddler Request used:

enter image description here

Jmeter Downloaded File

enter image description here

Save Responses to a file:

enter image description here

Jmeter downloaded content:

enter image description here

I noticed the file size upon downloading of Jmeter is different compare to manual download

1

There are 1 answers

1
Dmitri T On BEST ANSWER

Do you know what happens on the server side when you "manually downloading" the file? If you don't please ask your application developers as we know nothing about the application you're testing.

Also don't post code as images

The last image you shared looks like Base64 encoded content of the CSV file, in order to get the same result as for the "manual" download you need to decode the response using either __base64Decode() function (this guy can be installed as a part of Custom JMeter Functions bundle using JMeter Plugins Manager) or you can use JSR223 PostProcessor to decode the response from Base64 and save it to the hard drive, the relevant code would be something like:

 new File(vars.get('Export_File_VM_Appliance')).bytes = prev.getResponseDataAsString().decodeBase64()