Basic use of jmeter and quick generation of test reports

Brief: As a Java development novice, how can you not learn jmeter to do stress testing? Here we will introduce the installation and basic use, and finally use a test example to quickly generate a test report case.

Install

Download jmeter Twitter github Download Apache JMeter
Insert image description here is for linux. If you are using windows, download the following.

2. After downloading, unzip it to your own installation directory and configure the environment variables.
Environment variables:
a. Add the JMETER_HOME environment variable. The variable value is the path where JMeter is decompressed.
b. Edit the CLASSPATH variable and add %JMETER_HOME%\lib\ext\ApacheJMeter_core .jar;%JMETER_HOME%\lib\jorphan.jar;%JMETER_HOME%\lib\logkit-2.0.jar;
c. Append to PATH
: %JMETER_HOME%\bin 3. After configuring the environment variables, use cmd to check whether the configuration is correct: jmeter -v
Insert image description hereE:\file\apache-jmeter-5.5\bin This is the address of my installation package, 5.5 is the version

Test after installation

1. In the installation package directory: jmeter.bat Click to start the program and open the page.
Insert image description here
Congratulations on successfully installing it when you reach this page. You can create and test it.
2. Set Chinese, options=>chooes Language=>select the language environment you want , I set Chinese
3. Create a file, create a new file,
Insert image description here
and then create a thread group, the size of which can be adjusted by yourself.
Insert image description here
If you want to see the output results, Create a results tree:

Insert image description here
View the execution report:
Insert image description here
The above parameters are report analysis data as execution reference data

Generate test reports by naming

命令: jmeter -n -t jmeter测试文件.jmx -l 输出log.txt -e -o 报告导出地址

Let’s take a test case:
execute the command:

jmeter -n -t one-test接口.jmx -l test-log.txt -e -o ./report

Insert image description here
After execution, you can see the report generation directory file:
Insert image description here
View index.html through the browser to open the report:
Insert image description here
Okay, the entire test is completed, go try it and learn about it.

Supongo que te gusta

Origin blog.csdn.net/weixin_43829047/article/details/127373718
Recomendado
Clasificación