自动化工具 使用 newman 执行 postman 导出自动化脚本

fqivy · 2020年11月20日 · 最后由 wuwei 回复于 2020年11月20日 · 1678 次阅读
  1. 首先,安装 node.js,下载地址:
    https://nodejs.org/en/download/

  2. 选择 windows 64 位 msi 版本,进行下载,下载后,下一步,安装即可

  3. 需要安装好 node.js,将 node.js 的安装目录配置到 path 环境变量,配置好后,可以在 cmd 中,使用
    node --version 检验是否安装配置成功

  4. 安装好 node.js,安装 newman,在命令行中,输入命令
    npm install -g newman

  5. 安装完成,安装 newman html 报告生成器,执行命令
    npm install newman-reporter-html

  6. 安装完成,打开 postman,选择一个 collection,点击鼠标右键--》Export

  7. 导出后,使用 newman 执行导出的.json 脚本,执行命令:
    newman run D:\GF_13.json --reporters html --reporter-html-export d:/GF_13_result.html

生成报告如下:

newman run D:\GF_13.json --environment env.json --iteration-data data.csv --globals globals.json --timeout-request 5000 --reporters html --reporter-html-export d:/GF_13_result.html

共收到 1 条回复 时间 点赞

结合 jenkins 搞起来

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册