Postman interface testing ultra-detailed tutorial

Foreword: Recently, I am learning the interface test of postman. Here is a summary of the results of recent learning, hoping to help friends who need to learn. (Go directly to the official website to download, there are no special steps)

Official website download : Postman

Types of interface requests: get, post, put, patch, delete, copy, head, options, link, unlink, purge, lock, unlock, propfind, view . But currently, only get, post, put, delete, and head requests are mainly used.

1. After installation, double-click postman, which roughly displays:

 Conections: Collection, which can put all interface collections together.

Apis: can create api interface documents

Mock Servers: It is a kind of testing through interface documents, separating interface and data, and simulating behavior through conditions and result data, just like mock objects can simulate objects arbitrarily. It is generally used for front-end testing. When the background service is not completed, the function can be simulated through the interface, so that the development of the front-end and the background service are consistent.

Monitors: monitor api. During the test, any interface failure or warning will be received.

Flows: flow chart

History: History. You can see the running records of all interfaces during the test.

2. Create a collection of Conections, click the plus sign ---- create

                                          

 3. After creation, add the interface type and URL address, add parameters, and click send

 4. Check the interface document. The interface document we use here is swagger. All interface documents and parameters are recorded in this management system. If there is no such interface management now, you can ask the research and development brother to send a copy to yourself, as shown in the figure Down:

 Copy the address + the url address in the document into the URL text box, select the interface type, here is the get type

Note (each request requires a token token, as shown in the document, it is generally placed in the header; the parameter of query type in the document is placed in Params in Postman)

In addition, you can see that the hello in the url box is followed by & symbol connection parameters, such as: limit=10 & page=1 & communityName=test community, etc. These parameters are also the parameters in the following list

 This is the token in the Headers and the secret key behind it. Click F12 in the browser to see if the token is correct.

 Ok, the parameters are all set, just click Send

The returned 200 can be seen here, indicating that the operation has been successful. The returned parameters are also recorded in the interface documentation.

 Alright~ the simple interface request here is complete, let’s talk about local variables and global variables next time

Guess you like

Origin blog.csdn.net/qq_44361142/article/details/126603074
Recommended