6

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?

sudhansh_
  • 125
  • 1
  • 2
  • 14
  • I also have the issue with latest newman 4.5.3: C:\Users\lab2\AppData\Roaming\npm>newman run --folder C:\Users\lab2\Desktop -e s tand_27_146.json -d urdata6.json lk_ur_reg_test20190807.json error: ENOENT: no such file or directory, open 'C:\Users\lab2\AppData\Roaming\np m\stand_27_146.json' – uBaH Aug 07 '19 at 08:36

1 Answers1

9

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
Bernard Vander Beken
  • 4,848
  • 5
  • 54
  • 76
A.Joly
  • 2,317
  • 2
  • 20
  • 25
  • I normally run newman the same way as in your example, that works for me too. – sudhansh_ Jul 13 '17 at 17:54
  • Could you give an example of the folder run? If I understood the documentation correctly, by using --folder I'm trying to run all the collections inside a particular folder. – sudhansh_ Jul 13 '17 at 17:56
  • 1
    I checked this and it works for me : newman run C:\\.json --folder "" -e and it works. The only tests played are the ones inside the selected sub folder. You should check your syntax, maybe you missed something (like enclosing the folder's name between "") ? – A.Joly Jul 17 '17 at 06:21
  • I misunderstood the command to begin with. The command is to run a specific folder within a test file. \n I was trying to make it execute all the test files within a folder. – sudhansh_ Jul 17 '17 at 20:17