当前位置:网站首页>Interface test practical project 02: read interface test documents and practice
Interface test practical project 02: read interface test documents and practice
2022-07-28 01:01:00 【Program yuanyuexia】

This time, , We officially entered the testing stage .
Why do interface tests
There are many answers to this question , I just want to make an introduction for you .
01 Can accurately locate bug
such as : When you are testing a web page , It is found that the data displayed on the web page is incorrect , What are you gonna do? ?
Primary test , Direct mention bug To develop ; Advanced testing , It's going to position bug, But to locate bug, Be familiar with the interface .
02 Improve test efficiency
With 01, Naturally, there will be consideration of improving efficiency , This is one of .
second , If the item you are testing is separated from the front end and the back end , The back-end test time is often earlier than the front-end test time . If you are a back-end test , You have to wait for the front-end test , Just start the test ?
here , You need interface testing , Go through the back-end interface first , Solve problems as soon as possible .
03 Get familiar with the business from a technical point of view , Discover hidden dangers of the program
Now many large and medium-sized companies are advocating : The test should be able to walk through the developed code , Understand the business more deeply through code .
The first step of business code walkthrough , It often starts with the interface —— Look at the call , Look at the back-end logic processing , Look at the data returned from the backend , These are closely related to the knowledge of interfaces .
……
Interface document
Before the interface test , We need to understand the concept of interface document .
Interface document , To put it bluntly , It's a document for people to view ( It is generally used Restful Style writing ), Write standards by standardizing interface documents , Ensure that documents written by different people are readable and maintainable .
Otherwise A It's a writing style ,B It's a writing style ……N It's a writing style . As a test of you , Get one AB……N Class style interface document , You break down no ?
Open the previously provided interface test project , There is an interface document .

Read interface documentation , In addition to the necessary description , The key information is interface resources :
01 Familiar with interface resources ( The blue part )
URL Location resources : One URL( Interface ) Locate a resource ( What you want to get )
methond Operating resources : That is, what you want to do with this thing ( Beginner's understanding GET- check 、POST- increase 、PUT- Change 、DELETE- Delete , that will do )
02 Request resources ( The yellow part )
As shown in the figure , Incoming data ( It's usually json data format ), Initiate request
03 Respond to : Requested results ( The red part )
Response code of the request + The result of the response ( It's usually json data format )
And about the json Explanation of format , Just look at this picture ( It's worth collecting ~)

Interface request hands-on practice
After understanding the interface documentation , Let's practice a wave .
01 Start project , open postman
02 Read the interface documentation , About adding college information

03 Initiate request ( It corresponds to the red, yellow and blue parts above one by one ~)
http://127.0.0.1:8099/api/departments/
{"data":[ {"dep_id":"T01","dep_name":"AABB","master_name":"Test-Master","slogan":"Here is Slogan" } ]
above , success ! If you need a full set of projects, you can contact me , In case of problems , You can leave a comment below .
The next article explains the execution of test cases
边栏推荐
- Count the six weapons of the domestic interface cooperation platform!
- Leetcode - find the median of two positively ordered arrays
- [proteus simulation] 51 single chip microcomputer washing machine simulation control program
- LeetCode - 寻找两个正序数组的中位数
- Shell系统学习之循环结构
- Set data constructor
- 110. SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe
- 小波变换学习笔记
- [introduction to C language] zzulioj 1026-1030
- Jerry caused other messages to accumulate in the message pool [article]
猜你喜欢
随机推荐
接口测试实战项目02:读懂接口测试文档,上手操练
0-1背包问题
Rongyun IM & RTC capabilities on new sites
Branch and loop sentence exercises
7. Typescript part Foundation
[proteus simulation] 51 single chip microcomputer washing machine simulation control program
MySQL limit usage and large paging problem solving
Network device hard core technology insider firewall and security gateway (summary)
At least 42 employees are infected with novel coronavirus! Nokia announces closure of telecom equipment plant in India
Postman下载、使用教程
小波变换学习笔记
Basic operations of MySQL database (2) --- Based on data table
推荐系统-指标:ctr、cvr
Confused SCM matrix keys
LSB steganography
【原】【爬虫系列】简要获取一下知乎的最热门话题相关主题及描述信息
Interesting Huffman tree
KMP review + AC automata Prequel
至少42名员工感染新冠病毒!诺基亚宣布关闭印度电信设备工厂
Solve maze problem recursively









![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)