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

Test Passes in Postman (200 Ok) but fails in Newman (404 not found) #2410

Closed
Fairouz05 opened this issue Jun 22, 2020 · 4 comments
Closed

Test Passes in Postman (200 Ok) but fails in Newman (404 not found) #2410

Fairouz05 opened this issue Jun 22, 2020 · 4 comments

Comments

@Fairouz05
Copy link

I am sending a POST request by hardcoding a required parameter value in double-quotes in the request bosy, since the parameter only accepts unique values I am using a previously used value to check that the right response comes. Postman gives the expected response message with 200 ok status but Newman returns different response message (found using console.log(responseBody)) with 404 not found status

Here is the test -
if (responseCode.code === 200){ pm.test("Overlapping offering code", function () { pm.expect(pm.response.text()).to.include("An offering with the same OfferingCode"); }); }

In Failure Detail Newman console shows - response code is 200
expected response to have status reason 'OK' but got 'NOT FOUND'
at assertion:0 in test-script
inside "Overlapping Offering Code"

To add, I have validated JSON in the Request Body during runtime, it is okay while running collection from both Postman and Newman.

I am using Postman v7.26.1, Newman 5.1.0, Windows 10 64bit

@codenirvana
Copy link
Member

Can you share a scaled-down collection which we can use to reproduce this issue?

@Fairouz05
Copy link
Author

The APIs and endpoints I am using works on project installed in the local machine, so I don't think I can share that

@DannyDainton
Copy link
Collaborator

Hey @Fairouz05

Is this the same issue that you raised in the Postman community?

https://community.postman.com/t/test-passes-in-postman-200-ok-but-fails-in-newman-404-not-found/13610/5

Seems like you resolved the problem, can we close this issue?

@Fairouz05
Copy link
Author

Yes, it's the same issue

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

3 participants