步骤

1. 安装nodejs

查看node和npm的版本

2. 安装cnpm包管理工具

npm install -g cnpm --registry=https://registry.npm.taobao.org

3. 安装Newman和相关的两个插件模块

cnpm install -g newman

cnpm install -g newman-reporter-html

cnpm install -g newman-reporter-htmlextra

Newman使用方法

newman run  导出的测试json文件 [选项]

  • -e 指定环境变量json文件
    • 如何导出

      使用Newman执行postman测试脚本

  • -g  全局变量json文件
    • 使用Newman执行postman测试脚本

    • 使用Newman执行postman测试脚本

  • -r html
  • -r htmlextra
    • 使用Newman执行postman测试脚本

  • --reporter-html-export xxx.html 指定生成的html文件的路径
    • 使用Newman执行postman测试脚本

  • -n number 指定迭代的次数

 

 

相关文章: