使用postman - newman生成html测试报告

Newman 官方文档网站:

https://learning.postman.com/docs/postman/collection-runs/command-line-integration-with-newman/

一、环境配置

1. 安装 nodejs

下载地址: http://nodejs.cn/download/

一直next即可,配置环境变量,安装成功。
cmd输入 node - v

2. newman安装

cmd 输入以下命令,安装newman

npm install newman -g

安装完成,输入 newman -v 查看版本,检测是否安装成功

二、Postman配置

  1. 导出 collection,操作如下
    在这里插入图片描述
    在这里插入图片描述
    导出格式为 json 格式
    在这里插入图片描述

三、NewMan生成html报告

  1. 执行测试用例,并生成 html 测试报告
#html要提前在目录下创建好,再执行命令
newman run xxxxx.json -r -html --reporter-html-export E:\test.html
  1. 报告生成,打开html文件查看:
    在这里插入图片描述
发布了21 篇原创文章 · 获赞 0 · 访问量 549

猜你喜欢

转载自blog.csdn.net/pulapulahs/article/details/104960111
今日推荐