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

400 error in Newman for 4 tests out of 46, all pass in Postman #6964

Closed
TimEganGitHub opened this issue Jul 19, 2019 · 8 comments
Closed

400 error in Newman for 4 tests out of 46, all pass in Postman #6964

TimEganGitHub opened this issue Jul 19, 2019 · 8 comments
Assignees
Labels

Comments

@TimEganGitHub
Copy link

Describe the bug
A clear and concise description of what the bug is.
Test works in Postman but not in Newman. Getting a 400 error. Only 4 tests fail out of 46. All 46 passed before June 26th.

To Reproduce
Steps to reproduce the behavior:

  1. Tests runs in Postman but fails when running CICD in Newman
    The bug is reproducible every time in Newman, passes in Postman every time.
    First noticed the issue around June 26 2019. Worked for many months before.

Authorization: Inherit auth from parent (same as all the other tests)
Header:
Content-Type Application/json

Body:
{
"name": "{{chNameAr}}" ,
"financialBusinessSegmentId": 2,
"sortKey": 10

}

Pre-request script:
var randomNumber = (Math.floor(Math.random() * 100 + 1).toString());
var text = "NewArea" + randomNumber;
console.log (text);

pm.globals.set("chNameAr",text);
pm.globals.set("Num",randomNumber);

Tests:

pm.test("Successful POST request", function () {
pm.expect(pm.response.code).to.be.oneOf([201,202]);
});

pm.globals.unset("idFinAr");

if( pm.response.code===201) {

var jsonData= JSON.parse(responseBody);
id=jsonData.id;

console.log(id);
pm.globals.set("idFinAr", id);

}

Similar issue found at:
postmanlabs/newman#398

Expected behavior
A clear and concise description of what you expected to happen.
Expected Newman tests to pass as in the past.

Screenshots
If applicable, add screenshots to help explain your problem.
image

App information (please complete the following information):
Using the Postman App v6.7.4, Newman 3.9.0

Additional context
Add any other context about the problem here.
Similar issue found at:
postmanlabs/newman#398

@shamasis
Copy link
Member

Hey. We would need more details to debug this. I suspect this could be an issue with cookies or auth.

Can you reproduce this issue using a small subset of requests? Say 2 requests, with both passing in Postman and one failing in Newman. With this setup, if you can send me the exact request and response details from Postman Console and then verbose logs from Newman.

@TimEganGitHub
Copy link
Author

TimEganGitHub commented Jul 22, 2019 via email

@TimEganGitHub
Copy link
Author

TimEganGitHub commented Jul 22, 2019 via email

@shamasis
Copy link
Member

shamasis commented Jul 24, 2019

@TimEganGitHub ... it seems like that the attachment did not get through. Can you share the link to the collection by hitting “share” from the menu in Postman sidebar? And to run newman in verbose mode, I think there’s a --verbose option.

@shamasis shamasis added product/runtime support How do I ... ? Can I ... ? labels Jul 24, 2019
@TimEganGitHub
Copy link
Author

TimEganGitHub commented Jul 24, 2019 via email

@vikiCoder
Copy link

Hi @TimEganGitHub

Please share the collection link as previously suggested by @shamasis so that we can reproduce your issue at our end. If you don't know how to get a shareable link of the collection, please refer to this link from Postman Learning Center.

@TimEganGitHub
Copy link
Author

TimEganGitHub commented Aug 1, 2019 via email

@TimEganGitHub
Copy link
Author

TimEganGitHub commented Aug 2, 2019 via email

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

No branches or pull requests

3 participants