CSDN as a test architect teaches you Jmeter to generate stress test reports

According to the needs of major recruitment websites, familiarity with Jmeter for performance testing has almost become a necessary condition.

So today I will give you a wave of Amway here.

How to use Jmeter to generate a stress test report?
Condition preparation:
1. Jmeter3.2 (recommended, relatively stable)

2. JDK1.8 (installed under windows)

3. The test plan (jmx file) of the interface script has been written

start:

1. Open the cmd command mode and enter the bin directory of Jmeter

2. Enter jmeter -n -t D:\Jmeter\apache-jmeter-3.2\bin\test.jmx -l result.jtl -e -o D:\Jmeter\apache-jmeter-3.2\bin\WebReport PS:
red The jmx path address of the frame part and the path address of the generated html test report must be correct
. Parameter description:

-n: Execute JMeter in non-GUI mode
-t: Execute the location of the test file
-l: Specify the save file for generating test results, such as: jtl file format, txt file format
-e: After the test is completed, generate a test report
-o: Specify the storage location of the test report

 3. After successful execution, a WebReport file will be generated in the bin directory of Jmeter

 4. Open index.html to see our stress test report, isn’t it cool?

Note: If you want to regenerate a test report, you need to delete the jtl file and the webreport folder in the bin directory of Jmeter.

How to delete it?

It can be deleted manually directly in the bin directory of Jmeter, or can be deleted by command.

del /s /Q D:\Jmeter\apache-jmeter-3.2\bin\result.jtl    

//Delete the jtl file
rd /s /QD:\Jmeter\apache-jmeter-3.2\bin\WebReport    

//Delete the webreport folder


PS: If you find it troublesome to delete like this, you can consider writing a .bat file

Very simple, create a new txt file, write these 2 commands in it, save it, and then change the suffix of the document from .txt to .bat

Then every time you want to generate a test report, just execute this .bat file.

 

Thanks to everyone who has read my article carefully. Seeing the fans’ growth and attention all the way, there is always a need for reciprocity. Although it is not a very valuable thing, if you can use it, you can take it away for free: ① More than 2,000 copies of
software Testing e-books (mainstream and classic books should be available)
② Software testing/automated testing standard library information (the most complete Chinese version)
③ Project source code (forty or fifty interesting and classic hand-practice projects and source code)
④ Python programming language , API interface automated testing, web automated testing, App automated testing (suitable for beginners)

 

Guess you like

Origin blog.csdn.net/2201_76100073/article/details/130435502