0
votes

I have been trying to run a script associated with file upload using JMeter. Everytime, I run the script, the script fails with '404 Not Found' in the response. After a detailed analysis on the request generated in 'View Results Tree', i found out that the boundary value is generated dynamically every time i run the script (i am not sure if this is causing the issue). I have tried below steps:

  1. Defined the boundary in 'HTTP Header Manager' by setting "Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryp9kjnMqqJinub6Us" and unchecked 'use multipart/form-data for POST' in the HTTP Request (Parameter and File Upload tabs) and ran the script Result: 404 Not Found I still see the dynamic boundaries generated in the request from the result tree

  2. Did not define boundary in 'HTTP Header Manager' and checked 'use multipart/form-data for POST' in the HTTP Request (Parameter and File Upload tabs) and ran the script Result: 404 Not Found I see the dynamic boundaries generated in the request from the result tree

Other Notes related to request data: My HTTP Request data contains data in parameters and file upload tabs. Used Relative File Path (file exist in jmeter bin). I cannot enter the boundary information in HTTP Request body since I have the data in HTTP Request parameters and file upload tabs

Please advise on how to handle with dynamic boundaries and to make the file upload script successful. Greatly appreciate your help!

2

2 Answers

0
votes

HTTP Status Code 404 stands for Not Found, most likely your URL path is not correct, please double check it.

Going forward the easiest way is just recording your file upload request using JMeter's HTTP(S) Test Script Recorder, just copy the file to JMeter's "bin" folder and record the request using browser via JMeter's proxy - JMeter will generate the relevant HTTP Request sampler. You can add parameterization later on if required.

See Recording File Uploads with JMeter article for more detailed information on JMeter configuration for file upload events recording.

0
votes

You can try with removing content-type from your header and let jmeter handle that. Make sure you have checked the mulipart.