JMeter - file upload and file upload script

I am using JMeter to perform a performance test on a web page. I have a script to upload a file and upload a file. I need to upload a test upload file and upload script files.

Can anyone help me how to achieve this using JMeter.

Thanks Raj

+7
source share
1 answer

Actually there is no difficulty in recording load / download traffic using any HTTP sniffing tool and then emulate the recorded requests when using jmeter.

In the simplest case, you get the following:

  • A group of threads to set the number of test users and cycles;
  • to upload : 1 HTTP POST request with Use multipart / form-data for POST = true - to send the file as part of the request ;
  • to download : 1 GET HTTP request to download + Save responses to the file connected to it - to save the requested file.

It will look like this:

  Thread group
 Number of Threads = X
 Loop count = y
     .  .  .
     UPLOAD HTTP Request
     Method = POST
     Use multipart / form-data for POST = true
     - Send Files with Request - section:
     File Path = $ {testFile}
     Parameter Name = datafile
     MIME Type = ...
     .  .  .
     DOWNLOAD HTTP Request
     Method = GET
         Save Responses to a file
         Filename Prefix = downloadTest_
         Variable Name = testFile
     .  .  .

Here you can find a sample script implemented for the scheme above: file-upload-download.jmx .


The following posts may also be helpful:


You can also use custom jmeter-plugins .
These two seem extremely suitable for your tests:

+11
source

All Articles