Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rabbyribby opened this issue Feb 26, 2025 · 2 comments
Open

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

rabbyribby opened this issue Feb 26, 2025 · 2 comments

Comments

@rabbyribby
Copy link

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?

@VanshDagar27
Copy link

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

@rabbyribby
Copy link
Author

Great suggestion, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants