当前位置:网站首页>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
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 .
边栏推荐
- Cadence physical library lef file syntax learning [continuous update]
- JDBC introduction
- Which version of MySQL does php7 work best with?
- UCORE lab2 physical memory management experiment report
- Report on the double computer experiment of scoring system based on 485 bus
- Don't you even look at such a detailed and comprehensive written software test question?
- 接口测试面试题及参考答案,轻松拿捏面试官
- UCORE lab7 synchronous mutual exclusion experiment report
- 软件测试面试要问的性能测试术语你知道吗?
- Currently, mysql5.6 is used. Which version would you like to upgrade to?
猜你喜欢
Mysql database (I)
Portapack application development tutorial (XVII) nRF24L01 launch B
UCORE lab7 synchronous mutual exclusion experiment report
The minimum number of operations to convert strings in leetcode simple problem
Video scrolling subtitle addition, easy to make with this technique
Nest and merge new videos, and preset new video titles
软件测试方法有哪些?带你看点不一样的东西
Leetcode simple question: check whether two strings are almost equal
转行软件测试必需要知道的知识
Servlet
随机推荐
Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
Why can swing implement a form program by inheriting the JFrame class?
Cadence physical library lef file syntax learning [continuous update]
Wang Shuang's detailed notes on assembly language learning I: basic knowledge
About the garbled code problem of superstar script
CSAPP家庭作业答案7 8 9章
C language do while loop classic Level 2 questions
Global and Chinese market of portable and handheld TVs 2022-2028: Research Report on technology, participants, trends, market size and share
How to learn automated testing in 2022? This article tells you
Cadence physical library lef file syntax learning [continuous update]
Practical cases, hand-in-hand teaching you to build e-commerce user portraits | with code
Global and Chinese market of goat milk powder 2022-2028: Research Report on technology, participants, trends, market size and share
In Oracle, start with connect by prior recursive query is used to query multi-level subordinate employees.
The minimum sum of the last four digits of the split digit of leetcode simple problem
Video scrolling subtitle addition, easy to make with this technique
Mysql database (V) views, stored procedures and triggers
Don't you even look at such a detailed and comprehensive written software test question?
Maximum nesting depth of parentheses in leetcode simple questions
[pytorch] simple use of interpolate
DVWA exercise 05 file upload file upload