Haha I sent a HUGE message to vivek about this so let me just copy again here:
Could you help me read this object? I am reading the summary.run.executions.request.formdata I want to be able to iterate over files in the local directory in newman and send requests sending each file. I currently don’t see if this can be done as the UI in the Postman App only allows me to upload a document and not add a variable.
My node script with newman as a library:
newman.run({
collection: c,
iterationData: [{ "variable": "./Chris.png"}, {"variable": "./abinav.png"}],
}).on('iteration', function (err, args) { // on start of run, log to console
console.log('starting an iteration...');
}).on('done', function (err, summary) {
if (err || summary.error) {
console.error('collection run encountered an error.');
}
else {
console.log('collection run completed.');
// console.log(summary.run.stats);
summary.run.executions.forEach( item => console.log(item.request.body.formdata) );
}
});
my collection with variable in the formdata:
"body": {
"mode": "formdata",
"formdata": [
{
"key": "img",
"type": "file",
"src": "{{variable}}",
"disabled": true
}
]
The response I get when I try to see the formdata and if {{variable}} actually populated.
> PostmanPropertyList {
> members:
> [ PostmanFormParam {
> disabled: true,
> key: 'img',
> value: '',
> type: 'file',
> src: './Chris.png',
> contentType: undefined } ],
> reference:
> { img:
> PostmanFormParam {
> disabled: true,
> key: 'img',
> value: '',
> type: 'file',
> src: './Chris.png',
> contentType: undefined } },
> Type:
> { ... },
> _postman_listIndexKey: 'key',
> _postman_listAllowsMultipleValues: true }
> PostmanPropertyList {
> members:
> [ PostmanFormParam {
> disabled: true,
> key: 'img',
> value: '',
> type: 'file',
> src: './abinav.png',
> contentType: undefined } ],
> reference:
> { img:
> PostmanFormParam {
> disabled: true,
> key: 'img',
> value: '',
> type: 'file',
> src: './abinav.png',
> contentType: undefined } },
> Type:
> ...
I can’t determine if the response I’m getting back is successfully parsing the {{variable}} with the iterationData, I don’t know the difference from members and reference in the output object