newman run --folder -e does not execute, says too few arguments passed

sudhansh_ picture sudhansh_ · Jul 11, 2017 · Viewed 7.2k times · Source

I run

newman run --folder <folder path> -e <environment path>

but it returns an error

newman run: error: too few arguments

As per their documentation, I'm doing it correctly.

Did anyone face this? Has anyone resolved this?

Answer

A.Joly picture A.Joly · Jul 11, 2017

Did you set your collection-file-source ? --folder is required only if you use a collection set in a particular folder in that collection (ie. collection/folder1). You should have your command as follows :

newman run <my_collection_path>/<my_collection>.json --folder <folder-name> -e <environment_path>/<my_environment>.json

As an example, here is a command that I use and that works (though I don't try to play requests set in a folder of my collection):

newman run C:\Users\<myself>\Desktop\Tests.postman_collection.json -e C:\Users\<myself>\Desktop\Tests.postman_environment.json --reporters cli,html,json,junit --reporter-cli-no-summary --reporter-junit-export C:\Users\<myself>\Desktop\export_test.xml --reporter-html-export C:\Users\<myself>\Desktop\export_test.html --disable-unicode