当前位置:网站首页>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 .
边栏推荐
- How to do agile testing in automated testing?
- Servlet
- UCORE lab2 physical memory management experiment report
- Detailed introduction to dynamic programming (with examples)
- Install and run tensorflow object detection API video object recognition system of Google open source
- Cc36 different subsequences
- 150 common interview questions for software testing in large factories. Serious thinking is very valuable for your interview
- CSAPP家庭作業答案7 8 9章
- Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
- The four connection methods of JDBC are directly coded
猜你喜欢

Logstack introduction and deployment -- elasticstack (elk) work notes 019

Nest and merge new videos, and preset new video titles

Leetcode simple question: check whether two strings are almost equal
软件测试方法有哪些?带你看点不一样的东西

接口测试面试题及参考答案,轻松拿捏面试官

Install and run tensorflow object detection API video object recognition system of Google open source

Investment operation steps

The minimum number of operations to convert strings in leetcode simple problem

Build your own application based on Google's open source tensorflow object detection API video object recognition system (II)

Stc-b learning board buzzer plays music
随机推荐
Global and Chinese markets for complex programmable logic devices 2022-2028: Research Report on technology, participants, trends, market size and share
ucore lab5用户进程管理 实验报告
Emqtt distribution cluster and node bridge construction
150 common interview questions for software testing in large factories. Serious thinking is very valuable for your interview
[issue 18] share a Netease go experience
With 27K successful entry ByteDance, this "software testing interview notes" has benefited me for life
Réponses aux devoirs du csapp 7 8 9
Zhejiang University Edition "C language programming experiment and exercise guide (3rd Edition)" topic set
Global and Chinese market for antiviral coatings 2022-2028: Research Report on technology, participants, trends, market size and share
How to learn automated testing in 2022? This article tells you
Global and Chinese market of goat milk powder 2022-2028: Research Report on technology, participants, trends, market size and share
Software testing interview summary - common interview questions
線程及線程池
The four connection methods of JDBC are directly coded
Logstack introduction and deployment -- elasticstack (elk) work notes 019
如何成为一个好的软件测试员?绝大多数人都不知道的秘密
Face and eye recognition based on OpenCV's own model
安全测试入门介绍
Future trend and planning of software testing industry
接口测试面试题及参考答案,轻松拿捏面试官