postman
米雪唲2
测试从入门到入坑之。。。
展开
-
postman测试上传文件接口,批量执行时提示文件为空:TypeError: Cannot read property ‘name‘ of undefined
场景问题:批量执行接口时,全部勾选了,点击运行时,只运行了一部分接口问题分析:打开console,查看错误日志,进行分析,发现运行到出错的接口,就会导致批量执行结束解决思路:针对具体问题具体去分析解决可能出现的问题有:TypeError: Cannot read property 'name' of undefined查看单个接口执行,就能通过,批量时,需要上传文件的接口就报错文件为空,导致批量执行失败的解决方案按如下图方法进行设置,将所需的文件放下如下目录中TypeError: Ca原创 2021-04-23 15:52:53 · 3282 阅读 · 0 评论 -
mac上安装Newman并使用Newman执行postman生成的接口测试脚本生成测试报告
下载安装nodejshttps://nodejs.org/en/检查node是否安装成功安装Newman检查Newman是否安装成功安装HTML报告使用Newman执行接口脚本生成接口测试报告路径不对,找不到文件所在路径进入文件所在路径后打开终端再次执行执行成功,在当前文件目录下生成一个文件查看报告发现以上url的环境无设置环境变量1.打开postman2.点击环境变量3.点击导出export所需要的环境变量并保存再次执行:htmlextra 使用ht原创 2021-04-22 18:23:50 · 1113 阅读 · 2 评论 -
安装 npm install -g newman-reporter-htmlextra报错
安装adsl-172-10-9-42:~ mixueer$ npm install -g newman-reporter-htmlextra报错pm WARN [email protected] requires a peer of newman@^5.1.2 but none is installed. You must install peer dependencies yourself.npm ERR! code EACCESnpm ERR! syscall ac原创 2021-04-22 16:48:10 · 2733 阅读 · 1 评论 -
postman导出下载文件接口实例
postman导出下载文件接口实例场景有一个导出报表的功能,页面上点击了导出,下载了报表实例接口上,点击send and download,选择存放路径,即可完成发送请求并下载原创 2021-01-21 11:33:29 · 2429 阅读 · 0 评论 -
postman接口测试之上传文件和返回数据设置环境变量
前提:已登录,可使用上传接口上传前需对文件包进行解析分析接口1结果如下:需将返回信息中的部分字段值设置成变量,以方便下个接口使用//将数据解析成json格式var data=JSON.parse(responseBody); //获取接口返回值,需注意第一个data为变量,第个data为返回值中的data. 后面接字段名称var app_name=data.data.name;var version=data.data.version;var pakage=data.data.paka原创 2020-07-14 18:21:42 · 945 阅读 · 0 评论 -
postman接口报错:ijiami safety verification illegal access!!!
报错:The server encountered an unexpected condition that prevented it from fulfilling the request.javax.servlet.ServletException: ijiami safety verification illegal access!!! cn.ijiami.detection.filter.UnknownRefererSecurityFilter.doFilter(UnknownReferer原创 2020-07-14 15:04:13 · 312 阅读 · 0 评论 -
接口返回报错:“message“: “Required request part ‘file‘ is not present“
"status":500,"message":"Requiredrequestpart'file'isnotpresent"原因:参数错误原创 2020-09-22 09:52:18 · 1651 阅读 · 0 评论 -
postman使用局部变量
test原创 2020-07-14 15:40:25 · 1026 阅读 · 0 评论 -
postman请求无响应The server couldn‘t send a response:Fix this by turning off ‘SSL
postman 发送请求报错如下Could not get any responseThere was an error connecting to https://172.10.3.170:443/detection/common/configture/getPlatformInfoVO?systemCode=platform.Why this might have happened:The server couldn't send a response:Ensure that the bac原创 2020-07-14 14:56:54 · 5233 阅读 · 0 评论 -
postman报错:There was an error in evaluating the test script: JSONError: Unexpected token 'n' at 1:15
1.There was an error in evaluating the test script: JSONError: Unexpected token ‘n’ at 1:15 20200509150938nZ5W ^原因:格式错误//获取返回数据,JSON格式var keytime= JSON.parse(responseBody); 错误原因:此处不需要转为JSON格式的 //设置成环境变量pm.environment.set("key",keytime);...原创 2020-05-09 15:45:00 · 17539 阅读 · 0 评论 -
postman使用错误和postman环境变量使用方法集合
postman使用错误集合1.There was an error in evaluating the test script: JSONError: Unexpected token ‘n’ at 1:15 20200509150938nZ5W ^原因:格式错误//获取返回数据,JSON格式var keytime= JSON.parse(responseBody); 错误原因:此处不需要转为JSON格式的 //设置成环境变量pm.environment.set("key",keytim原创 2020-05-09 15:42:17 · 5683 阅读 · 0 评论