当前位置:网站首页>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]
- pytest
- Réponses aux devoirs du csapp 7 8 9
- Wang Shuang's detailed notes on assembly language learning I: basic knowledge
- Global and Chinese market of goat milk powder 2022-2028: Research Report on technology, participants, trends, market size and share
- 线程及线程池
- 软件测试工作太忙没时间学习怎么办?
- Leetcode simple question: check whether the numbers in the sentence are increasing
- Why can swing implement a form program by inheriting the JFrame class?
- Vysor uses WiFi wireless connection for screen projection_ Operate the mobile phone on the computer_ Wireless debugging -- uniapp native development 008
猜你喜欢
CSAPP Shell Lab 实验报告
Threads et pools de threads
CSAPP家庭作業答案7 8 9章
Don't you even look at such a detailed and comprehensive written software test question?
ucore lab7 同步互斥 实验报告
The latest query tracks the express logistics and analyzes the method of delivery timeliness
软件测试需求分析之什么是“试纸测试”
How to learn automated testing in 2022? This article tells you
Investment operation steps
ucore lab8 文件系统 实验报告
随机推荐
Dlib detects blink times based on video stream
What level do 18K test engineers want? Take a look at the interview experience of a 26 year old test engineer
Global and Chinese markets of PIM analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
Statistics 8th Edition Jia Junping Chapter 4 Summary and after class exercise answers
[oiclass] share prizes
Practical cases, hand-in-hand teaching you to build e-commerce user portraits | with code
UCORE lab8 file system experiment report
Mysql database (II) DML data operation statements and basic DQL statements
STC-B学习板蜂鸣器播放音乐
JDBC introduction
[oiclass] maximum formula
Investment operation steps
Leetcode simple question: check whether the numbers in the sentence are increasing
Query method of database multi table link
Global and Chinese markets for GaN on diamond semiconductor substrates 2022-2028: Research Report on technology, participants, trends, market size and share
Differences between select, poll and epoll in i/o multiplexing
Brief description of compiler optimization level
pytest
软件测试有哪些常用的SQL语句?
Global and Chinese markets of MPV ACC ECU 2022-2028: Research Report on technology, participants, trends, market size and share