Avyaan
Avyaan

Reputation: 1313

How to handle MIME Multipart/form-data POST while using jmeter for load testing?

I've got a problem trying to run a test plan in JMeter which contains a multipart/form-data POST. For some reason the web server does not respond with the expected response when JMeter does the POST (which was recorded with the proxy). Please tell me the exact configuration to handle it(if any).

Upvotes: 1

Views: 3656

Answers (1)

Dmitri T
Dmitri T

Reputation: 168082

As per Upload and Download Scenarios with Apache JMeter guide

  • Check that “Use multipart/form data for POST” is ticked
  • Check that files for upload actually exist in their relative location or use the full paths
  • Provide the correct MIME Type

The combination of above should do the trick for you.

If your file upload assumes authenticated user, make sure that you have HTTP Cookie Manager is present and enabled and in case of any dynamic parameters, like viewstate input value or JSESSIONID cookie you pass them properly. Use a sniffer tool like WireShark to ensure that your request is an exact replica of browser request.

Upvotes: 2

Related Questions