When using Newman as a library, replace newman.execute() with newman.run(). The configuration object keys have changed to align with the new V3 CLI structure.
Key Changes:
data $\rightarrow$ iterationDatanumber $\rightarrow$ iterationCountdelay $\rightarrow$ delayRequestrequestTimeout $\rightarrow$ timeoutRequeststopOnError $\rightarrow$ bailavoidRedirects $\rightarrow$ ignoreRedirectsexitCode $\rightarrow$ suppressExitCodenoTestSymbols is discontinued (use disableUnicode if applicable).
Reporter Configuration:
Instead of top-level keys like outputFile or html, use the reporters array and a reporter object to specify export paths for each reporter type.
// V3 Library Usage Example
newman.run({
collection: 'collection.json',
environment: 'env.json',
iterationData: 'data.csv',
globals: 'globals.json',
iterationCount: 2,
delayRequest: 10,
bail: true,
timeoutRequest: 5000,
suppressExitCode: true,
ignoreRedirects: true,
reporters: ['html', 'junit', 'json'],
reporter: {
html: { export: 'htmlOutput.html' },
junit: { export: 'xmlOut.xml' },
json: { export: 'jsonOut.json' }
}
}, callback);