Jmeter Note 1: Send a request to execute and view the results

The use of jmeter

If you don’t like it, don’t comment. I’m currently only writing about what I’ve come across, and will continue to update in the future.

1. The interface can be adjusted

1. Create thread groups, requests and parameter meanings

step1: Create a thread group before creating a request: test PlanRight-click add ->Treads(Users)->Tread Group
the thread group interface:
Insert image description here
The meaning of each parameter of the thread group is as follows: Todo time is limited and will be added later.

step2: Create an http request.
Create a request in the jmeter thread group: right-click add ->Sampler -> HTTP Request
the get request interface. The infographic that needs attention is marked:
The get request parameters are in the form of key-value
Insert image description here
pairs in the post request interface. The parameters are passed by Body Data in json format. Then httpRequest passes the value GET and adjusts it to POST.

step3: Create response assertion
Add response assertion in jmeter thread group:Add ->. Assertions -> Response Assertion
Insert image description here

step4: Create an http header information manager.
Right-click on the jmeter thread group and add the http header information manager: Add -> Config Element ->HTTP Header Manager
content settings:
Insert image description here
step5: Create a result tree and aggregation report.
Right-click on the jmeter thread group and add a result tree:Add -> Listener -> View Result Tree

The result tree will be responsible for displaying the results of sending requests. The interface:
Insert image description here

Right-click on the jmeter thread group to add an aggregation report: Add -> Listener -> Summary Report
the aggregation report displays the number of requests, qps, average response time, throughput and other information, mainly based on the interface calling situation.
Insert image description here

2、demo

Thread group settings:
Insert image description here
Request content settings:
Insert image description here
Assertion:
Insert image description here
Information header manager:
Insert image description here
Click to execute:
Insert image description here
View execution results in the result tree:
Insert image description here
Aggregation report can view execution results, including request number sample, average value, tp90, tp95, tp99 minimum value, maximum value value, error rate, throughput and other information.
Insert image description here

2. Used for pressure testing

Another way for jmeter to run scripts is to do interface testing by executing commands.
It can be executed locally: jmeter -n -r test.jmx -l test.jtl -e -o /xx/xx/resultReport
It also supports execution in the Linux environment:jmeter -n -r test.jmx -r -l test.jtl -e -o /xx/xx/resultReport

For the execution of the command, please refer to: jmeter stress test

Guess you like

Origin blog.csdn.net/qq_17033579/article/details/131866379