I have a collection with a single request: https://api.onlinedatabasetool.com/api/catalogline/{{id}}
When I run newman using the command line with a data file I successfully make 30 requests:
newman run Product-enviroment.postman_collection.json -d response.json
When I try to run the same collection programmatically it runs 30 iterations (which corresponds to the amount of rows in the data file) but it is not actually doing the requests, just iterations.
This is the file Iβm executing:
const newman = require('newman'),
fs = require('fs');
newman.run({
collection: require('./Product-enviroment.postman_collection.json'),
iterationData: './response.csv',
reporters: 'cli'
}).on('beforeRequest', function (error, args) {
console.log(args.request.body.raw);
}).on('request', function (error, args) {
console.log(args.response.stream);
});
Here is an article which is where I got the file from:
Not sure what Iβm doing wrong.