JMeter - File upload and file download scenario

后端 未结 1 440
醉梦人生
醉梦人生 2020-12-09 06:33

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 s

相关标签:
1条回答
  • 2020-12-09 06:58

    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
    0 讨论(0)
提交回复
热议问题