table of Contents
Brief introduction
- Newman was born as a postman, designed to run the postman to write a good script
- Use Newman, you can easily use the command line to execute postman collections
- Newman consolidated its position postman interface testing artifact
installation
1. First download Node.js
https://nodejs.org/en/
2. Install NodeJs (very easy to install, there is not much to do introduction)
3. Open cmd, input node, if there is no error, but displays ">", indicating that the installation was successful node
4. Installation NPM (if nodejs own, may be omitted)
opened cmd, input npm install --global --production windows-build- tools
to install these dependencies take some time, patience installation
5. Installation NewMan then
open cmd, input npm install -g newman
6. newman version by viewing the test installation was successful, open cmd, enter newman -v, versioning information that is successfully installed
use
1. Perform collection
format:
newman run{json filesource} //绝对路径比较准确
//(Windows系统后面不需要分号,linux系统需要)
//例如
newman run D:\dafmng-api.json
2. Direct Send a request
//表示URL为
newman run https://www.getpostman.com/collections/cb208e7e63e3wt33 --environment dev_environment.json
3. Set the number of rounds of test run
//表示跑10轮测试
newman run D:\dafmng-api.json -n 10
4. Set the data files
5. Save the output to a file