Jmeter entry test file upload and download interface

One, JMeter introduction

JMeter is an open source project developed by the Apache organization. It was originally designed for Web/HTTP testing. At the same time, it is relatively mature in implementing calls to various interfaces. Therefore, it is often used for interface function testing and performance testing. It can well support various common interfaces, such as HTTP(S), WebService, JDBC, JAVA, FTP, etc., and display test results in various forms.

Two, JMeter installation and startup

2.1. JMeter software network disk extraction link: https://pan.baidu.com/s/1h3tSkPxfVNPlDXXH_ExUdQ extraction code: 3ls7 

2.2. After decompressing the file, open apache-jmeter-5.2.1/bin/jmeterw.cmd to open the software

Three, JMeter test interface settings

3.1, add thread group

Number of threads: the amount of program concurrency.

ramp-up: Decide how long to start all threads. If there are 10 threads and the ramp-up period is 20 seconds, then JMeter takes 1020 seconds to start and run all 10 threads. Each thread will start 2 seconds (20/10) after the previous thread started. Ramp-up needs to be long enough to avoid a large workload when starting the test, and small enough that the last thread is started before the first one finishes. 

As shown below:

3.2, add http request

Set the request address, method, port number, timeout time, link time and request parameters, as shown in the figure below

 When the file is placed in the file parameter, there are some differences in the mime type:

pdf file-----> application/pdf

excel file---------->application/excel

Wait and not list them one by one.

Other parameters should be added in the parameter position in the figure.

3.2.1, HTTP header manager

Set token and other information 

3.2.2, HTTP Cookie Manager

3.3, add view result tree

3.4. Summary report and results

The adding method is as shown in the figure above.

The results are as follows:

3.5. Aggregate reports and results

The adding method is as shown in the figure above.

The results are as follows:

3.6. Summary graphs and results

The adding method is as shown in the figure above.

The results are as follows:

Four, common problems

 

Guess you like

Origin blog.csdn.net/weixin_42228950/article/details/105976501