Newman command reference
Use Newman’s command line options to customize your collection runs. You can use options to set up a collection run, configure request delays and timeouts, specify SSL details, and more. When you run a collection iteratively, you can specify different data sets and variables for each iteration. After a run finishes, Newman exits with a status code that you can pass to your continuous integration (CI) tool.
To use options, add them to the newman run command after you specify the collection file or URL:
To view a list of available options for Newman, run the following command:
Basic options
Setup options
Request options
SSL options
Output options
More configuration options
Exit status
By default, Newman exits with a status code of 0 if everything runs as expected without any exceptions. You can configure your continuous integration (CI) tool to pass or fail a build based on Newman’s exit codes. To override the default exit code for the current run, use -x or --suppress-exit-code option.
Use the --bail option to make Newman stop a run if it encounters a test case error with a status code of 1. This status code can then be used by your CI tool or build system. For example:
Data file example
To use a different set of data or variables for each iteration in a collection run, use the -d option to specify a JSON or CSV file.
The following example shows a JSON data file for a run with two iterations, with each iteration using different values for a set of variables.
To run the collection, use the -d option and specify the data file. For example:
The following example shows the same data formatted in a CSV file.
To learn more about formatting data files for collection runs, see Run collections using imported data.