当前位置:网站首页>【接口测试基础】第十一篇 | 详解Postman关联接口及批量执行用例集
【接口测试基础】第十一篇 | 详解Postman关联接口及批量执行用例集
2022-04-22 18:11:00 【奈思特】
Postman关联
介绍:应用于多个http请求之间,有数据关联或依赖关系
A接口 依赖 B接口的数据
1.向B接口发送http请求,获取数据
2.将数据设置至全局变量(环境变量)中
3.A接口获取全局变量(环境变量)数据值,进行使用
- 案例:
请求获取天气接口,提取响应结果中的城市,将城市名,给百度搜索接口使用
- 实现步骤:
1.创建用例集,分别创建查询天气请求和百度搜索的请求

2.查询天气请求Tests中,编写代码获取城市名,写入全局变量
//获取全部响应结果
var jsonData =pm.response.json();
//从响应结果中获取城市名
var city = jsonData.weatherinfo.city;
//将城市名写入全局变量
pm.globals.set("glb_city",city)
3.点击Send按钮,发送请求,查看设置的全局变量

4.修改百度搜索氢气,使用全局变量,按城市名进行搜索
http://www.baidu.com/s?wd=手机 {
{glb_city}}

Postman批量执行用例集


版权声明
本文为[奈思特]所创,转载请带上原文链接,感谢
https://blog.csdn.net/a272329874a/article/details/124348451
边栏推荐
- Expansion convolution paper notes
- Soft test advanced item notes | software integration technology
- Pytorch Note57 Pytorch可视化网络结构
- Dynamic programming: multiple knapsack problem
- 国产芯片DP9637-K总线收发器替代L9637D芯片和SI9241
- Notes on soft test high items | contents of feasibility study
- 接口测试 Mock 实战(二) | 结合 jq 完成批量化的手工 Mock
- 多次调用 BAPI 之后,最后一次性 COMMIT WORK,会有什么问题吗?
- 如何彻底删除电脑上的文件?
- 还弄不懂相对路径和绝对路径,这篇文章带你简单剖析
猜你喜欢

golang-gin-websocket问题
Esprima ECMAScript parsing architecture

Pikachu File Inclusion (File Inclusion Vulnerability)

数字化靶场的未来方向

spaCy第一个例程(中文文本自动标注)

Pytoch Note58 CNN可视化
![[2021] Tencent autumn recruitment technology post programming arrangement supermarket](/img/ce/1b196d91fa4412cbf0c1471855a4b7.png)
[2021] Tencent autumn recruitment technology post programming arrangement supermarket

Soft test high item notes | PERT three-point estimation

leetcode - 234. 回文链表

Pytorch Note57 Pytorch可视化网络结构
随机推荐
National Information Exchange Model(NIEM)操作手册
2022年,网传苹果即将发布的新机型iPhone 14 Pro和iPhone 14 Pro Max将会是全新屏幕造型,不再是刘海屏,你对新屏幕造型的iPhone 14期待吗?
DLL的封装及调用
Soft test high item notes | enterprise application integration
Alipay open platform application - Township Health Center Application
leetcode 111:二叉树的最小深度
【思考与进步】:关于自己的遗憾
Dynamic programming: multiple knapsack problem
Pikachu File Inclusion (File Inclusion Vulnerability)
Leetcode 108: convert an ordered array into a binary search tree
Soft test advanced item notes | soft skills
Domestic chip dp9637-k bus transceiver replaces l9637d chip and si9241
接口测试 Mock 实战(二) | 结合 jq 完成批量化的手工 Mock
Deleted items can be recovered even after the outlook Deleted Items folder is empty
接口协议之抓包分析 TCP 协议
Secyun assisted the "SaaS cloud management platform solution based on pseudo application integration framework" released by CETC 32
手机运行内存应该怎么选?
常见报错记录
The USB flash disk cannot be recognized when it is inserted into the computer. How to solve it?
Interface test mock practice (II) | complete batch manual mock in combination with JQ