The first step:Export collection and enviroment files from postman and upload them to a Linux hostStep Two:Install node and NPM on Linux before installing Newman with NPMStep Three: Install NewmanExecute: sudo npm install-g Newman if: Newman-v is able to show the release instructions installed successfully! If there is an error, something like this:-bash:./newman:/usr/bin/env:bad interpreter:no such file or directoryThis is due to the incorrect location of the node interpreter specified at the beginning of this file Newman! WORKAROUND: 1. Confirm that the location of the local node interpreter, such as the location of the node interpreter, has been set to:/usr/local/bin/node2. Find the Newman interpreter directory in Linux, such as the author is:/usr/bin/newman: VI/ Usr/bin/newman, modify the file at the beginning of the node interpreter for the correct path! Directory for native node interpreter:/usr/local/bin/node. So the Newman command should be able to use it!Fourth Step: Set the timer task run NewmanExecution: Export tz= "Asia/shanghai" source ~/.BASHRC This is configured for the current user China Shanghai time Zone execution: crontab-e: Adding a timed Task # m H Dom Mon Dow command30 * * * n Ewman run/home/lkj/newmanjob/mybitt.postman_collection.json-e/home/lkj/newmanjob/mybitt.postman_ Environment.json >>/home/lkj/newmanjob/result.txt;python3/home/lkj/newmanjob/sendmail_linux.py;rm-rf/home /lkj/newmanjob/result.txtCrontab is the Nano editor by default and can be usedCommand Select-editor ModifyVim mode editing
Automated testing with Newman+postman on Linux