[测试] Postman自动化接口测试-newman

newman命令行执行

1. 安装newman

1). 安装nodejs
https://nodejs.org/en/download/
安装成功后: node -v 查看版本

2) 打开CMD
npm install -g newman

3) 查看newman版本
newman -version

2.Postman导出TestCase

在collection那里,export,选择Collection V2,导出为json。如果使用了environment,则需要导出该environment的json配置。

3. 命令行执行

进入FirstTest.postman_collection.json所在目录,执行以下命令:

newman run FirstTest.postman_collection.json --reporters cli,html --reporter-html-export result.html

会成该目录下生成测试报告 result.html
在这里插入图片描述

发布了13 篇原创文章 · 获赞 2 · 访问量 2540

猜你喜欢

转载自blog.csdn.net/a10703060237/article/details/104339898