newman+jenkins+postman做自动化测试

1.首先需要下载newman:

(1)npm install newman

(2)npm install newman-reporter-html(这个是为了生成测试报告,不然会报错)

注:npm需要下载node.js工具

2.newman run 运行newman命令

-e 加载环境变量的数据

-g 加载全局变量的数据

-n case 运行次数,默认1次

--folder 运行collection中指定的folder

--reporter html,junit指定生成的测试报告类型

在jenkins输入批处理命令:

newman run [d:/run/postman......json(运行文件的地址)] --reporter html --reporter-html-export [d:/...(生成报告的地方)]

posted @ 2018-11-16 17:52  胡大姐  阅读(387)  评论(0编辑  收藏  举报