
接口测试
baobao95
这个作者很懒,什么都没留下…
展开
-
postman基础
postman断言pm.test("Status code is 200", function () { pm.response.to.have.status(200);});// 校验json格式的响应体的值// pm.test("断言result", function () {// var jsonData = pm.response.json();// pm.expect(jsonData.result).to.eql(0);// });pm.test(原创 2021-06-01 11:05:09 · 278 阅读 · 2 评论 -
使用Newman执行postman测试脚本
步骤1. 安装nodejs查看node和npm的版本2. 安装cnpm包管理工具npm install -g cnpm --registry=https://registry.npm.taobao.org3. 安装Newman和相关的两个插件模块cnpm install -g newmancnpm install -g newman-reporter-htmlcnpm install -g newman-reporter-htmlextraNewman使用方法newm原创 2020-08-01 15:30:40 · 796 阅读 · 1 评论 -
postman的变量
Postman里支持5种不同的变量作用域Global Collection Environment Data Local关系如下图, 作用域小的变量会屏蔽掉更大作用域中同名的变量, 比如在全局作用域和局部作用域同时定义了username,那么在提交请求时,将使用局部作用域中的username的值.下面分别介绍创建方法全局变量全局变量可以在collections, requests, test scripts, and environments之间共享数据,也就是说,属于整个w.原创 2020-07-22 17:25:04 · 522 阅读 · 0 评论