JMeter is open source software, 100% developed in Java language, supports API testing and performance testing of mainstream protocols (HTTP, HTTPS, WebService, gRPC), and is an excellent testing tool software.
For a program written in the java language, the program needs to run, and there are two ways to run the program externally (basically the same):
1、.war
2、.jar
Start method:
java -jar .war
java -jar .jar
jmeter.properties: configuration file
Jmeter.bat windows system startup items
Jmeter.sh non-windows system startup items
A thread group can be equivalent to Collections in PostMan, that is, a collection, so there can be many API test cases in a thread group
Install Java1.8, configure environment variables, and install jmeter
After installing jmeter, click jmeter.bat for Windows system (click jmeter.sh for other systems):
How to add a thread group:
Change name:
How to add a simple controller:
Method to add HTTP request:
HTTP request page:
Add the view result tree to view the test results, and add a method to view the result tree:
View the results tree page:
View the JSON format of the result tree:
Add HTTP header manager:
When multiple information headers need to be added, they can be combined and added in one information header manager:
Form data format can add data here:
Ways to add JSON assertions:
JSON assertion page:
The result of the assertion is added by:
Assertion result display page:
When encountering a constant domain name and port, you can add HTTP request default values to replace all domain names and ports, for example:
Can be replaced with:
When a variable is encountered, a JSON extractor can be added to replace the variable, for example:
Variable substitution (${}):
The replacement page is as follows:
When creating multiple thread groups, if there are programs that you do not want to execute, you can disable:
Data acquisition method
【Message 777】
Friends who want to get source code and other tutorial materials, please like + comment + bookmark , triple!
After three times in a row , I will send you private messages one by one in the comment area~