当前位置:网站首页>The most detailed postman interface test tutorial in the whole network. An article meets your needs

The most detailed postman interface test tutorial in the whole network. An article meets your needs

2022-07-06 15:13:00 Test Xiaowan

Catalog

1、 Preface

2、 Interface theory

3、 Interface instance

One 、POST

Two 、GET


1、 Preface

   When I haven't actually done interface test before , The concept of interface testing is rather vague , Only Baidu , View various interface instances , And then it doesn't work , Now, all kinds of interfaces are lost , Finally, I have a practical understanding . Because it's just a functional test of the interface , So now it's using postman Do a test , It's easier , Of course, this is just the beginning of interface testing , It's just the tip of the iceberg , In the future, efforts will be made to interface pressure 、 Interface performance 、 Interface automation is moving closer .

2、 Interface theory

   We often say that the interface is API, Interface test is a test to test the interface between system components . The interface test is mainly used to detect the interaction points between the external system and the system as well as between the internal subsystems . The focus of the test is to check the exchange of data , Transfer and control the management process , And the mutual logical dependence between systems .

   In fact, interface testing is no different from normal function testing , The difference is that the function test is to enter values on the page , Submit the data to see the result , And interface tests don't have pages , Specify the call address on the document through the interface , Request parameters , Splicing message , Then send the request , Check the return result .

                            

 

3、 Interface instance

One 、POST

POST Requests are used to send data , Below XX For example, the system allocates processing plants

1、 Product manager's PRD The documentation requirements are as follows ( Modify the interface of the distribution processing plant as follows ):

1) New factories are added in the interface of distribution processing factory ID Field , Integer types , Not required ;

2.) If the picking list has been approved , Limit the allocation of processing plants only in the status to be audited , If not, remind “ Picking list is not to be approved , Can't allocate processing plants ”;

2、 The developer's interface documentation is as follows :

The name of the interface :XX The system allocates the factory interface

Interface path :POST
/process/requisitionOrder/updateDistributeStatus

Request parameters :

Headers:

Body:

{
  "factoryId": "123",// Processing factory ID
  "factory": "XX dress ",// Name of processing plant 
  "produce_order_id": [// Production and voucher making ( Pure number )  Multiple use , Separate 
    1134360
  ]
}

Return the data :

{
  "msg": "success",
  "code": "0",
  "info": " Successful operation "
}

3、 The tester's test cases are as follows :


4、 The tester performs the test cases as follows :

1) open Postman, Fill in the interface information , The specific operation is shown in the figure

notes : In the interface document URL No environmental address , So will URL When copying to the address bar , Add the address of the environment , For example, the address of the test environment + Interface URL,

Of course, if there are multiple environments , You can use the environment to configure functions , The specific configuration steps are in 4) Step by step .

2) Combine test cases , After combining and transforming the parameter information , Check back JSON Data and PRD Is it consistent

3) After the test case traversal is complete , That's it POST Interface function test requested .

4) Here's a description of postman Environment configuration of

First step , Pictured

The second step , Pictured

The third step , Pictured

Step four , Pictured

Step five , Pictured ( This is for situations with multiple environments , For example, there are usually test environments 、 Acceptance environment 、 Production environment )

Two 、GET

GET Requests are used to get data , Let's say XX For example, the system obtains the delivery bill ,( Only some data information is listed below for demonstration )

1、 Product manager's PRD The documentation requirements are as follows :

2、 The developer's interface documentation is as follows :

The name of the interface : Synchronize the delivery bill to XX system interface

Interface path :GET
/purchase/prepareOrder/importListFromPlm

Request parameters :

Query:

Return the data :

{
    "msg": "success",
    "code": "0",
    "info": {
        "list": [
            {
                "billNo": "ML201902205005",         // Bill number 
                "billDate": "2019-02-20",           // Bill date 
                "factory": " The production department of sarvan clothing - Ye Lin ",   // Name of supplier 
                "materialSku": "16MLZS0513-628",    // materiel SKU
                "num": 20,                          // Number 
                "purchasePrice": 0,                 // Purchase unit price 
                "billSum": 0,                       // The amount of the bill 
            }
        ]
    }
}

3、 The tester's test cases are as follows :

4、 The tester performs the test cases as follows :

1) open Postman, Fill in the interface information , The specific operation is shown in the figure

notes : In the interface document URL No environmental address , So will URL When copying to the address bar , Add the address of the environment , For example, the address of the test environment + Interface URL,

Of course, if there are multiple environments , You can use the environment to configure functions , For specific configuration steps, please refer to POST Description of

2) Combine test cases , After combining and transforming the parameter information , Check back JSON Data and PRD Is it consistent

3) After the test case traversal is complete , That's it GET Interface function test requested

 

 

Thank everyone who reads my article carefully !!!

If you can use the following information, you can take it away directly :

1、 Self study development or test the necessary complete project source code and environment

2、 Test all templates in the work ( test plan 、 The test case 、 Test report, etc )

3、 Classic interview questions for software testing

4、Python/Java Automation test practice .pdf

5、Jmeter/postman Interface test full set of video acquisition

I personally sorted out some technical materials I have sorted out in my software testing career in recent years , contain : e-book , Resume module , Various work templates , Interview treasure , Self study projects, etc . Please leave a message in the comment area. Thank you .

原网站

版权声明
本文为[Test Xiaowan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060919128961.html

随机推荐