0
votes

Uploaded xml file content is not showing in the request body in Jmeter.

Jmeter version: 5.4.1

We have .xml file upload scenario, recorded using Blazemeter. After downloading the recorded script to Jmeter, necessary token co-relation and extracting required values using RegEx been done. Then tried to run the script, it fails at the upload request.

Recorded script doesn't have "FileUpload" tab with location. I updated with the file location too. As suggested in other queries/blogs, observed the traffic using other tools to see if any header value is missing and incorporated that too still it fails at upload request.

Observed that, the request body shows file content in other tools where as in Jmeter the file content is not shown.

ZAP tool request body:

enter image description here

Jmeter: enter image description here

enter image description here

Also, the headers shows in green color, not sure if any specific reason to look at it under view results tree - http request. enter image description here

1

1 Answers

0
votes

Try re-recording the request (it may be a single request only, enable proxy just for it) using JMeter's HTTP(S) Test Script Recorder, it should generate the HTTP Request sampler with "Files upload" section and Use multipart/form-data for POST box checked.

Just make sure to copy the XML file(s) you're uploading to "bin" folder of your JMeter installation prior to uploading the file, this way JMeter will be able to properly "catch" the request.

More information: Recording File Uploads with JMeter