newman icon indicating copy to clipboard operation
newman copied to clipboard

File location to attach a file to the body of a post request

Open rabbyribby opened this issue 10 months ago • 2 comments

If I attach a file to the body of a post request, then newman can't find it and the test fails. It works fine in postman. What directory should I put the file in for newman to see it.

Is there is a working directory for newman?

rabbyribby avatar Feb 26 '25 12:02 rabbyribby

The issue might be caused due to the fact that the file you are specifying in newman might not be in the working directory. Try giving the path of the file as following and running the collection again: 1.)Place the file in the same directory where you’re running the Newman command. 2.)Use the --working-dir flag when running Newman: newman run sample_collection.json --working-dir .

Here the dot will take care of the full path of the file

GoldFoylee avatar Feb 26 '25 13:02 GoldFoylee

Great suggestion, thanks!!

rabbyribby avatar Feb 26 '25 19:02 rabbyribby