If you are unable to upload a file via PUT request using Jmeter, then you are on the right Page.
For PUT request, the Jmeter does not provide option “Use multipart/form-data”. It is disabled.
Solution:-
Launch wireshark
Open Jmeter and add an HTTP sampler. Change the Method to PUT and add server Name, Protocol. See the highlighted items in the below screenshot.
Now, you need to create the same body for this request as you can see in the below wireshark screenshot. Start from line starting with “First boundary” and end till line starting with “Last boundary”. Please see the sample data below. I have removed all the extra fields from the body. Also, here “\r\n” means “new line”. Please take care of “\r\n”. See my final Jmeter request.
The below screenshot shows the ‘header’ that you need to add into the header manager (This should be the child of the HTTP sampler).
Finally, please see below the actual request in Jmeter.
Hi, this can be used to upload a file in a JSF web app? thanks
ReplyDeleteSorry for the delayed response. I hope it should work fine for JSF web apps too.
DeleteLet me know how it goes.