命令行執行
安裝
postmanApi文檔,可生成apikey
newman 相關報告插件,可查看詳細報告插件用法
#首先安裝node.js,然後npm安裝newman
npm install -g newman
newman run examples/sample-collection.json -r cli,json
npm install -g newman-reporter-html #基礎html報告
npm install -g newman-reporter-htmlextra #美化全面的html報告
newman run /path/to/collection.json -r htmlextra,csv
使用在線collections運行
1 Generate an API key
2 Fetch a list of your collections from:https://api.getpostman.com/collections?apikey=$apiKey
3 Get the collection link via it’suid
:https://api.getpostman.com/collections/$uid?apikey=$apiKey
4 Obtain the environment URI from:https://api.getpostman.com/environments?apikey=$apiKey
5 Using the collection and environment URIs acquired in steps 3 and 4, run the collection as follows:
newman run "https://api.getpostman.com/collections/$uid?apikey=$apiKey" --environment "https://api.getpostman.com/environments/$uid?apikey=$apiKey" -r htmlextra,cli
貼一下報告的圖(htmlextra)