当前位置:网站首页>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 .
边栏推荐
- Four methods of exchanging the values of a and B
- Want to learn how to get started and learn software testing? I'll give you a good chat today
- Global and Chinese market of pinhole glossmeter 2022-2028: Research Report on technology, participants, trends, market size and share
- 基于485总线的评分系统双机实验报告
- Threads and thread pools
- MySQL数据库(五)视 图 、 存 储 过 程 和 触 发 器
- MySQL数据库(三)高级数据查询语句
- Practical cases, hand-in-hand teaching you to build e-commerce user portraits | with code
- JDBC introduction
- Query method of database multi table link
猜你喜欢
Description of Vos storage space, bandwidth occupation and PPS requirements
ucore lab7 同步互斥 实验报告
遇到程序员不修改bug时怎么办?我教你
CSAPP家庭作業答案7 8 9章
软件测试面试要问的性能测试术语你知道吗?
自动化测试中敏捷测试怎么做?
Cadence physical library lef file syntax learning [continuous update]
软件测试工作太忙没时间学习怎么办?
China's county life record: go upstairs to the Internet, go downstairs' code the Great Wall '
Stc-b learning board buzzer plays music
随机推荐
Fundamentals of digital circuits (II) logic algebra
What are the business processes and differences of the three basic business modes of Vos: direct dial, callback and semi direct dial?
Which version of MySQL does php7 work best with?
Introduction to variable parameters
C language do while loop classic Level 2 questions
STC-B学习板蜂鸣器播放音乐2.0
The latest query tracks the express logistics and analyzes the method of delivery timeliness
Want to learn how to get started and learn software testing? I'll give you a good chat today
MySQL数据库(四)事务和函数
Install and run tensorflow object detection API video object recognition system of Google open source
Mysql database (I)
Iterators and generators
How to learn automated testing in 2022? This article tells you
Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
[Ogg III] daily operation and maintenance: clean up archive logs, register Ogg process services, and regularly back up databases
A method and implementation of using VSTO to prohibit excel cell editing
[HCIA continuous update] advanced features of routing
Global and Chinese market of barrier thin film flexible electronics 2022-2028: Research Report on technology, participants, trends, market size and share
線程及線程池
Differences between select, poll and epoll in i/o multiplexing