当前位置:网站首页>Interface Association of postman
Interface Association of postman
2022-06-30 01:15:00 【Software testing Xiaobai】
In the project , Multiple interfaces are related to each other before .
Such as : After registration, you can log in , It is impossible for a business to add, delete, modify, and query one interface at a time , If a parameter can be added, modified, and then deleted D It's all related , You need to get the first interface , Then when the following interface is used, you can call
Here is an example : The request needs to log in to get token, The next request needs to carry the corresponding token To make a request
One 、json The extractor implements Interface Association
1、 Request login interface , The corresponding... Is returned after success token
Cold start : When starting the app , There is no process for this application in the background , At this time, the system will re create a new process to assign to the application , The starting mode is cold starting .
Hot start : When starting the app , The application process already exists in the background ( example : Press back key 、home key , The app will exit , However, the process of the application will still remain in the background , You can enter the task list to view ), So in the case of existing processes , This startup will start the application from the existing process , This startup mode is called hot startup .

2、 After the first step is successful Tests Pass through js To set global variables
//json The extractor gets the return value
var jsonData = pm.response.json();
// You can print and view the returned token value
console.log(jsonData.detail.token)
// Obtain the corresponding value according to the interface result level , Set to global variable
pm.globals.set("token", jsonData.detail.token);

After sending, you can view the details in the control view :

See global variable value :

3、 Send the second interface request , It can be done by { {token}} Reference the set global variable

4、 Send a request

Two 、 The regular expression extractor implements interface correlation
It is still after the first step of the request Tests Pass through js To set up
//match matching , obtain token value
var result = responseBody.match(new RegExp('"token":"(.*?)"'))
// Take the subscript 1 Value
console.log(result[1]);
// Set to global variable
pm.globals.set("token",result[1]);

Other operations are the same as above .
welfare

边栏推荐
- Taguchi experimental method
- 解决choice金融终端Excel/Wps插件修复visual basic异常
- Rubymine development tool, refactoring and intention operation
- Some thoughts on small program subcontracting and verification of uiniapp subcontracting optimization logic
- Experience of C language course design: open source sharing of "push box" course design works
- 优秀的测试/开发程序员与普通的程序员对比......
- 【Proteus仿真】8位端口检测8独立按键
- Video to image -cv2 Videocapture() usage
- Kwai reached out to the "supply side" to find the "source" of live broadcast e-commerce?
- 【Proteus仿真】8比特端口檢測8獨立按鍵
猜你喜欢

How to refuse the useless final review? Ape tutoring: it is important to find a suitable review method

How to customize templates and quickly generate complete code in idea?

The first unlucky person watching eth 2.0

Analysis of natural frequency and buckling load of cylinder by finite element method

Practical application of information security

MySQL installation steps (detailed)

如何拒绝期末复习无用功?猿辅导:找准适合自己的复习方法很重要

如何统一项目中包管理器的使用?

Stimulsoft Reports报告工具,Stimulsoft创建和构建报告

数字垃圾是什么?跟随世界第一位AI艺术家,探索元碳艺术
随机推荐
HC32M0+ GPIO
Video to image -cv2 Videocapture() usage
3-6sql injection website instance step 5: break through the background to obtain web administrator permissions
How to create a module in the idea and how to delete a module in the idea?
传统微服务框架如何无缝过渡到服务网格 ASM
眼底出血术后需注意事项//每天必看
挖财的课程靠谱吗,让开户安全吗?
Go 中的 UDP 服务器和客户端
CSV文件格式——方便好用个头最小的数据传递方式
Crmeb SMS for program configuration of knowledge payment system
Preliminary understanding of NVIDIA Jetson nano
Quality management of functional modules of MES management system
Antd - tree structure: default deployment node attribute failure - Basic promotion
How to view the size of all files in a folder?
latex如何输入一个矩阵
What is digital garbage? Follow the world's first AI artist to explore meta carbon Art
Three text to speech artifacts, each of which is very practical
PHP wechat merchant transfer to change initiating merchant transfer API
Sentinel source code analysis Chapter 9 - core process - lookprocesschain finding resource processing chain
Programmers with a monthly salary of less than 30K must recite the interview stereotype. I will eat it first!