Xiaobai must understand the knowledge points before learning the Jmeter tool

Preface The
project is being refactored. After the product has passed the requirements review, a functional prototype is completed, and the development and testing are beginning to catch up. After I finish writing test cases for this function, the development (front-end and back-end) is still in the development and self-test stage. So our boss called to learn automated testing tools in advance, to prepare for the following testing work, designated Jmeter, and have time to learn Fiddler packet capture tool. So, I will summarize my learning experience and share it with friends in need.

If you have read my previous article, you should know that I am a liberal arts student and I am not a solid foundation in network and engineering knowledge. Therefore, before I learned about the tools, I chose many basic/introductory courses on MOOC.com, watched the videos by myself, and searched for blogs and tools related materials while reading and practicing. Therefore, the following sources of information are from the videos of Mukenet and the notes of your own study summary. If there is any inappropriate or unclear statement, please point it out and make progress together.

Basic knowledge involved in Jmeter tool

(1) Common interface protocol

  • Http Hypertext Transfer Protocol
  • Https Secure Hypertext Transfer Protocol
  • FTP file transfer protocol
  • TCP network control protocol
  • IP Internet Protocol
  • UDP user data protocol

(2) Http protocol response code (testing can locate errors)

  • 1XX: Information response type, which means that the request is received and the processing continues (intermediate state, instant)
  • 2XX: Processing success response category, indicating that the action was successfully received, understood and accepted eg: 200 (processing success)
  • 3XX: Redirection response class. In order to complete the specified action, further processing must be accepted eg: 329 (redirection)
  • 4XX: Client error, client request contains syntax error or cannot be executed correctly eg: Response code 404> The resource we requested does not exist
  • 5XX: Server error, the server cannot execute a correct request correctly. eg: 500
    response code will be displayed in the server log. There have been exceptions thrown by the server in the previous business, and the remaining bugs have not been dealt with, and big errors.

(3) Http protocol request response model (the life cycle of a request or simple software layering) The
Response model
client initiates a request to the API layer (after logical processing) and sends the data to the DB layer (database)
1. Client
function test, performance testing, automated testing
two interface layer
interface testing, functional testing, performance testing, automated testing
three database layer
can be developed to use the sql statement to separate out the performance test

Scenario: Login
1. The client initiates a request to the API interface layer-
1.1 The user fills in the user name and password on the client, clicks to log in, and sends the request
2. The api receives the user request initiated by the client-
2.1 api verifies the business logic
2.1. 1. verify that the user name and password are legitimate
, such as: user name requirements must be actual phone number (11, beginning 1, the second 34578)
If the validation fails, that is, the user name is not legitimate, you need to give the client returns the response code
, such as code value 1, 2, 3

  • 1 represents the username format is wrong
  • 2 represents the user name or password is wrong
  • 3 means the password format is wrong

3. The api will send the data entered by the user to the DB layer (read the database)
Create, Read, Update, Delete
Select * from user where
userName = "MRlin" and passWord = "123456";
-3.1 if the database query is successful, it returns 1, If it fails, it will return 0.
4. The DB will return the number of entries in the query database to api
5. Api will return the success or failure status code to the client.
6. The client will return information to the user.

(4) Jmeter application

  • 1. BS architecture application performance
  • 2. HTTP protocol interface function and performance function: request mode support performance: a large number of concurrent access, based on correct data
  • 4. MySQL database performance (browser, api, database)
  • Five, MongoDB database performance
  • Six, support the development of custom Java components

(5) Common HTTP request methods
①get
②post
other methods (actions)
③options ④head ⑤connect ⑥put ⑦delete ⑧The
basic difference betweentraceget request and post request
Write picture description here
Get request:
Url: http://127.4.7.4:8080?Username=zhangsan&password=123
Post request:
Url: http://127.4.7.4:8080
Request body:
{
["Username":"zhangsan"
"password":"123"]
}

Subsequent practical articles will be displayed in detail in the tool.

(6) Jmeter download and use environment
Because Jmeter is developed based on the Java language, you need to have a Java environment before using it. The path to install Jmeter and partners who configure the Java environment can refer to the following blog:
https://blog. csdn.net/zl1zl2zl3/article/details/78194194

After the installation is complete, those who are interested can follow the test of the content of the article again. As the first experience, there will be a sense of accomplishment. Later, when I mature and use the tool, there will be a more detailed introduction.

Guess you like

Origin blog.csdn.net/Yorkie_Lin/article/details/80550067