Olivier
Olivier

Reputation: 445

Automate tests with Postman and Newman

Here I run into a concern about using Newman on a test campaign I created in Postman. Indeed in some of my test scenarios I test the upload of a PDF file. Requests that handle upload all return status 201 in Postman as I see fit.

In Newman, however, some of these requests return a 415, as if the format was not supported by the API.

Enter image description here

In Postman, the request header looks like this:

Enter image description here

I do not understand why the API returns the correct status (201) in Postman and not in Newman (415). My environment is Ubuntu 20.04 (Focal Fossa).

Upvotes: 0

Views: 365

Answers (1)

Ziwdigforbugs
Ziwdigforbugs

Reputation: 1214

When you export your collection, the path of the file you are uploading may change depending on where that file sits on your local machine. So you need to know in advance the path of that file in the container and set it to that path.

Upvotes: 1

Related Questions