Reputation: 37
I am trying to upload a file using jmeter on the front end. There are three files that are need to be uploaded and then the Submit button will be enabled. Is there any way to it through jmeter?
I am able to do it from the back end. But i want to use the URL of the website through Jmeter in order to do performance testing of the website.
Upvotes: 1
Views: 24285
Reputation: 31
Steps to perform:
Screenshot below:
Upvotes: 3
Reputation: 168157
As per very main page of the Apache JMeter project:
JMeter is not a browser.
As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).
So JMeter won't check the status of the "Submit" button, it acts on protocol level and will send the corresponding request in any case.
In regards to the File Upload bit itself. You can do it with HTTP Request sampler, just make sure:
You use POST
(in some cases it can be PUT) method
Use multipart/form-data for POST
box is checked
In Files Upload
section the following values are provided:
<input type="file" ...
tag, you can figure that out from upload page source code)Actually the easiest way to build a file upload request is just recording it, see Recording File Uploads with JMeter guide for more details.
Upvotes: 4