Automated testing with Newman+postman on Linux

Source: Internet
Author: User
Tags install node

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.