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
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
E:\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.
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,
and then create a thread group, the size of which can be adjusted by yourself.
If you want to see the output results, Create a results tree:
View the execution report:
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
After execution, you can see the report generation directory file:
View index.html through the browser to open the report:
Okay, the entire test is completed, go try it and learn about it.