<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">
Go to top icon

How to upload images in JMeter?

Kishore Bhamare Nov 21, 2018

JMeter

In performance testing scenarios, you might come up with image file uploading-downloading functionality in any web application. In this blog, I will explain to you how we can upload different image files in JMeter.

For creating image files upload scenario in JMeter, follow below steps

  1. Launch Apache JMeter (I am using 5.0 version)
  2. Right-click on Test Plan--> Add-->Threads-->Thread group
  3. Right click on Thread group--> Add--> Sampler--> HTTP Request
  4. Here in Basic--> Parameters tab we need to do change following things:

    http-request
    • HTTP Request is set to POST method
    • Ensure ‘Use multipart/form-data’ checkbox is checked
    • Input other fields as asked

  5. Basic--> Files Upload

    file-upload
    • File Path: Make sure you give the full file path, including the file name. You can dump all images in a single folder and create any variable e.g. ${filepath}. Call this variable from CSV file where actual path is mention.
      Path: apache-jmeter-5.0\bin\Images\kishore.jpg
    • Parameter Name: This must be the same as the ‘name’ attribute as it appears in the page source.
    • MIME Type: MIME stands for ‘Multipurpose Internet Mail Extensions’. For any kind of Image as per the image file extension, we can use
      • image/gif
      • image/png
      • image/jpeg
      • image/bmp
      • image/webp
      • image/vnd.microsoft.icon

Using the above mentioned steps you should be able to upload images using JMeter. Let me know your queries in the comments below.

Similar Blog

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.