Not able to use iteration data while calling a PUT API
-
My API
{{myurl}}/api/layouts/{{id}}
-{{myurl}}
is environment, and{{id}}
i am reading from CSV file -
Using Newman as programmatically
var newman = require('newman'); var fs = require('fs'); newman.run({ collection: require('./putlayout.postman_collection.json'), environment: require('./local.postman_environment.json'), iterationCount :2, iterationData: require('./id.csv'), insecure: true, reporters: 'cli', }).on('console', function (err, logs) { console.log(logs.messages); });
-
Error i am facing : /Users/chetatri/Desktop/gtmhub/newman/id.csv:1
70b2ae4e-f421-4af8-8593-b40355ad08c2
^^
SyntaxError: Invalid or unexpected token
70b2ae4e-f421-4af8-8593-b40355ad08c2
-
csv file used
(base) ESZAR1M0186:newman chetatri$ cat id.csv
id
9ef99ac4-b2dc-4943-a562-e292f7bd12c7
a8e0dadd-7257-4e6b-937d-b22b8509a508
(base) ESZAR1M0186: Newman chetatri$ -
Example for JSON is available
:iterationData: [{ โvarโ: โdataโ, โvar_betaโ: โother_valโ }],