Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter - File upload and file download scenario

Tags:

jmeter

I am using JMeter to do performance test a web page. I have a scenario for uploading a file and downloading a file. I need to load test uploading file and downloading file scenarios.

Can any one help me how to achieve these using JMeter.

Thanks, Raj

like image 400
Nagarajan Avatar asked Dec 30 '11 04:12

Nagarajan


1 Answers

There are actually no difficulties in recording upload/download traffic with any HTTP sniffing tool and then emulate recorded requests in using jmeter.

In the simplest case you will get something like the following:

  • Thread Group to setup number of test users and loops;
  • for upload: 1 http POST request with Use multipart/form-data for POST = true - to sent file as part of request;
  • for download: 1 http GET request for download + Save Responses to a file listener attached to it - to save requested file.

This will look like the following:

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 sample script implemented for schema given above: file-upload-download.jmx.


The following posts may also appear useful:

  • Testing load document functionality with JMeter.
  • Performance testing: Upload and Download Scenarios with Apache JMeter
  • How to Test Image Upload Functionality With JMeter
  • JMeter Testing Multiple Random File Uploads
  • Handling File Upload in JMeter

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

  • Response Times Over Time
  • Bytes Throughput Over Time
like image 133
Aliaksandr Belik Avatar answered Sep 20 '22 18:09

Aliaksandr Belik