postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.83k stars 1.16k forks source link

I'm getting 2 issues while running my script on a docker in GitLab. Issue #1. Unable to get local issuer certificate at request. Issue#2. Assertion Error: Status code is 200 expected { Object (id, _details, ...) } to have property 'code' at assertion:0 in test-script. It's working fine when I run the script in both Postman and Newman. Can you please help me on this? #1755

Closed kvvineesh closed 5 years ago

kvvineesh commented 5 years ago
  1. Newman Version (can be found via newman -v): 4.1.0

  2. OS details (type, version, and architecture): Windows 7, 64 bit

  3. Are you using Newman as a library, or via the CLI?: library

  4. Did you encounter this recently, or has this bug always been there: I noticed this recently as I started running my script through GitLab.

  5. Expected behaviour: I should get the Status as 200 and my assertion should pass.

  6. Command / script used to run Newman: newman run Generate_Access_Token.postman_collection.json --reporters cli, html --reporter-html-export report.html

  7. Sample collection, and auxiliary files (minus the sensitive details): { "info": { "_postman_id": "392fa8ba-2f61-43df-be6e-ea06cbf07bb5", "name": "Generate Access Token", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "GenerateAccessToken", "event": [ { "listen": "test", "script": { "id": "b0219bcc-2961-421e-ada5-66c3fcd7096e", "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ] } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "correlationId", "value": "04ef78f3-7f50-497b-9a78-4caf870cac0c" }, { "key": "client_secret", "value": "1925eB20B16c4560a330850e7E4b2C0a" }, { "key": "client_id", "value": "40297376d0e74f61ad51427254c3302e" } ], "body": { "mode": "raw", "raw": "{}" }, "url": { "raw": "https://api-exp-dev.lfg.com/api/esignature/generateAccessToken", "protocol": "https", "host": [ "api-exp-dev", "lfg", "com" ], "path": [ "api", "esignature", "generateAccessToken" ] } }, "response": [] } ] }

  8. Screenshots (if applicable): gitlab-error1 gitlab-error2

codenirvana commented 5 years ago

@kvvineesh You need to setup SSL client certificates using the --ssl-client-cert & --ssl-client-key option. Know more: https://github.com/postmanlabs/newman#ssl-client-certificates

The second issue is an assertion error because the response status is not 200, due to request failure.