Closed svarshney2311 closed 4 years ago
Hey @svarshney2311 ,
This isn't the repo for Newman, that would be https://github.com/postmanlabs/newman
I'm not sure what you're trying to do - Are you just trying to run a Postman collection with Newman from the CLI?
Once you have installed Newman on your machine, the command would be something like this:
newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv
The code that you extracted from the Newman repo is for using Newman as a library in a NodeJS script.
Could you please share the steps to execute Newman as Library in a Nodejs script.
const newman = require('newman'); // require newman in your project
// call newman.run to pass options object and wait for callback newman.run({ collection: require('./sample-collection.json'), reporters: 'cli' }, function (err) { if (err) { throw err; } console.log('collection run complete!'); });
Something like that I guess:
cd
to the new dirnpm init
npm i -S newman
node <filename>.js
This isn't really a specific question about the htmlextra reporter, more of a general how do I create a node project.
https://philna.sh/blog/2019/01/10/how-to-start-a-node-js-project/
I'm going to close this issue.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Good day. I am new to run Newman. COuld you please tell the steps to execute below command: like if this code has to update anywhere than run command line or ??
I have this code but don't know what to do next?