
postman
文章平均质量分 67
postman
小福气_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
postman常用方法集合
1.设置环境变量postman.setEnvironmentVariable("key", "value");//postman 5.0以上版本设置环境变量的方法pm.environment.get("key", "value");2.设置全局变量postman.setGlobalVariable("key", "value");//postman 5.0以上版本设置...原创 2020-01-03 18:03:30 · 375 阅读 · 0 评论 -
存取环境变量
1、存储token值var jsonData =JSON.parse(responseBody);//获取body中返回的所有参数postman.setEnvironmentVariable("token",jsonData.data.info.token);//把返回参数中的keys设置为环境变量2、取用token值...原创 2020-01-03 15:26:32 · 160 阅读 · 0 评论 -
postman自动化测试-Tests
// 检查格式pm.test("response 应该包含 code,data,message", function () {pm.expect(pm.response.text()).to.include("code");pm.expect(pm.response.text()).to.include("data");pm.expect(pm.re...原创 2020-01-03 15:22:02 · 836 阅读 · 0 评论 -
Pre-request Script
// 项目名称function getGuid () {var d = new Date().getTime()var guid = 'xxxx-xxxx'.replace(/[xy]/g, function (c) {var r = (d + Math.random() * 16) % 16 | 0d = Math.floor(d / 16)ret...原创 2020-01-03 15:19:40 · 361 阅读 · 0 评论