Recently just finished a small project, similar to the classroom exam part of the function needs to test in a number of students login system, and perform the exam, to submit the paper such a process, began to consider using loadRunner, later found too heavy, so the use of Jmeter, light learning cost is low, two days to do in the results, Don’t sum up a lot of things are easy to forget, nonsense is not much, on the body (this article for intuitive, using many screenshots, loading slow please wait for harvest, (*^__^*) hee hee……) .
The main interface:
Jmeter Basic Settings:
The Options button allows you to switch languages
Engineering operation process:
Project Catalog:
Component is introduced
View result number
Aggregated report
Graphic results
Thread group
Adding a thread Group
Add the element
HTTP request default value
JDBC Connection Configuration
Jar package installation method:
JDBC Configuration method
JDBC requests
Debuger Sampler
Circulation controller
counter
HTTP Cookie manager
The HTTP request
(1) Send Parameters
The HTTP header
In response to assert
In order to verify whether the request is correct or not, request assertion is generally set to verify whether the status code returned by the request is correct, as follows: the status code returned by the user after logging in is “errcode” :0. The result includes this content even if the request is approved.
JSON Extractor (JSON parser)
{
"errcode": 0."user": {"id": 6,"userName":"XXX0001"."pwd":"45b1017f751948aa"."desc":"{ \ "name \" : \ "zhao four \" and \ "birthday \" : \ "1991.03.111 \", \ "politicalStatus \" : \ "\", \ "nation \" : \ "\", \ "education \" : \ "\", \ "the health \" : \ \ "" ,\"company\":\"\",\"duty\":\"\",\"dutyStartTime\":\"\",\"dedicatedNet\":\"\",\"tel\":\"\" }"."roleApp": {"id": 4."name":"Students"}, "token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX25hbWUiOiJEWFRHMjAxODA4MDEyMDkiLCJ1dWlkIjoiYzY3NDhhMjAtYTVkYS0xMWU4LThmNG ItZDcxYzA5YzJhMTFlIn0.ofbHY9LbGQPiI9Hs3ZQHLM6WWYKmk4meNUFgu-YlRLI",}}Copy the code
If the controller
This case has been explained to the end, other functions have not been used by bloggers, today to share here.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — the dividing line between a firm and not China — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
2018.08.23 New content
User-defined variables
Earlier we talked about HTTP request default values. This is just a way to avoid repeating the address and port of the request and fixing variables. A more convenient option is “User-defined variables” in this section, where users can set more global variables to be used in requests. Bloggers met today, for example, we will develop a good project launch test on the test machine, where you need to modify multiple places: user authentication service address + port, system service address + port, JDBC to access database location, even SQL statements can be on the user variables, modified at any time convenient to query the conditions of the user.
The usage is as follows:
“Right click – Add – Configure components – User-defined variables” to complete the addition.
${_loginIP} = ${loginIP} = ${loginIP} = ${loginIP} = ${loginIP} = ${loginIP} = ${loginIP} = ${loginIP} = ${loginIP} = ${loginIP}
Thank you for your reading, I hope you can have a hand slip point attention (in fact, is ready to play “I hope you have a harvest”), welcome to exchange, common progress!