-3

I need to do load test on a web application where images will be uploaded(Similar to the site https://imgbb.com/). I am unable to perform this. Can anyone help me out with this.

I have tried working it out but no luck. Please find the below screenshots for reference. Firstly after recording the script i have enhanced the script with correlation and have executed, then I have received the following error. enter image description here

After doing some R&D, I have made certain changes(Implementation from default to HttpClient4, and Request parameters to Body Data) and executed again, still no luck. Changes Made enter image description here

Result enter image description here

Can someone please suggest now

Bottu Praveen
  • 72
  • 1
  • 10

2 Answers2

2

You're doing something very weird. The easiest way to create a file upload request using JMeter is just recording it using JMeter's HTTP(S) Test Script Recorder

  1. Start JMeter's HTTP(S) Test Script Recorder
  2. Import ApacheJMeterTemporaryRootCA.crt file into your browser (it is required as imgbb.com is using HTTPS protocol and JMeter will need MITM certificate in order to be able to decrypt and record secure traffic)
  3. Copy the file you'll be uploading into "bin" folder of your JMeter installation (otherwise JMeter will not be able to find it)
  4. Perform upload request in the browser - JMeter will capture it under Recording Controller

See Recording File Uploads with JMeter article for more details.


Just in case if you want or need to build the request manually the relevant HTTP Request sampler configuration should look like:

  1. Parameters tab:

    JMeter HTTP Request Parameters

  2. Files Upload tab

    JMeter Files Upload Tab

  3. You should see the following output in the View Results Tree listener:

    JMeter File Upload View Results Tree listener

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Dmitri T, thanks for the solution. But im still wondering why the same has not worked when i have recorded through Blazemeter. – Bottu Praveen Jul 25 '18 at 06:32
0

To upload files from JMeter Http sampler you have to add file path to http sample and corresponding mime type..

Open Files to upload tab in the HTTP sampler enter the file path .. If the file is in JMeter's bin directory you can give relative path , if the file resides somewhere on the disk give absolute path and enter corresponding mime type You can find mime type here. For more information on load testing with JMeter please follow the link

Rohit
  • 601
  • 4
  • 12
  • Thanks for your response Rohit. I have followed the similar approach initially and the result is the first screen attached in my description. – Bottu Praveen Jul 22 '18 at 17:23