当前位置:网站首页>JMeter generates test reports

JMeter generates test reports

2022-06-22 12:01:00 Yezi

* If used jemeter, Suggest looking backwards , Go straight to step three , The point is that the order

  • step : install , Create script , Generate test reports through the tests corresponding to the scripts

1. install

1.1 Download address

https://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-5.4.1.zip

1.2 Official website address

https://jmeter.apache.org/download_jmeter.cgi

1.3 Unzip and install

zip When the download is complete , decompression

2. Script creation

2.1 Open software

  • Mode one

***\apache-jmeter-5.4.1\bin

stay bin Open in directory jmeter.bat, function jmeter

  • The way 2

Or enter bin Catalog , double-click ApacheJMeter.jar You can open it jmeter 了 ( Open mode selection java)

2.2 Add test plan

Right click test plan -> add to -> Threads ( user ) -> Thread group

2.3 Add details of a single plan

Right click thread group -> add to -> Sampler -> HTTP request

2.4 add to HTTP Request information

Request parameters

Right click HTTP request -> The configuration element -> HTTP Header Manager

  • Add... Inside Authorization and Content-Type
Return results

Right click HTTP request -> Monitor -> View the result tree

  • You can right-click to clear . To view on the right, you can select json Look convenient ( For me, )

2.5 Test and clear

The green arrow in the upper toolbar ( Play button ) It's startup , gear + The button of the broom is to clear the running result .

2.6 Save script

ctrl+s, Or in the menu bar , file -> Save the test plan as …

3. Generate test reports

stay bin Under the table of contents , Enter the following code , Create the test report .

./jmeter -n -t "D:\App Tools\apache-jmeter-5.4.1\a_report\test.jmx" -l report.jtl -e -o "D:\App Tools\apache-jmeter-5.4.1\a_report\aa3"

The first path is the path to the test script , The second path is the path to the generated file ( No Chinese ).

After each creation , Need to be in bin Under the table of contents , Delete report.jtl.

原网站

版权声明
本文为[Yezi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221129136794.html