I have a problem with sending form with file through JavaScript using Jmeter. It simply does not succeeded. Unfortunately I do not have any logs from that situation.
But when I am sending form without file parameter through JavaScript using Jmeter it succeeded. Once I add parameter with a file it does not.
Tried to check option in Jmeter Use multipart/form-data for POST
with file upload section filled but it does not help.
In test I am using HTTP Request sampler with:
- POST method
- multipart/form-data for POST box is checked
- In Files Upload section the following values are provided:
File Path
Parameter Name
File MIME Type - additional parameters are provided for form
==== EDIT ====
Before – not working
After changes – working
Advertisement
Answer
Just record it
- Start JMeter’s HTTP(S) Test Script Recorder
- If your application uses HTTPS protocol – import JMeter’s self-signed certificate into your browser
- Configure your browser to use JMeter as the proxy
- Copy the file you’re going to upload to “bin” folder of your JMeter installation
- Perform the upload in browser
- JMeter will generate proper HTTP Request sampler and HTTP Header Manager
- Replay the request
- It should be successful (assuming the previous requests were, for example if you need to log in prior to uploading the file)
More information: