纽曼-邮递员整合

时间:2020-03-13 18:21:01

标签: newman testrail

我需要将Newman与Postman集成的帮助,当我们从Mac Terminal执行以下Newman命令时遇到错误:-

**Newman command :-**
set TESTRAIL_DOMAIN=xxx.testrail.io
set TESTRAIL_USERNAME=vtulashyam@xxx.com
set TESTRAIL_APIKEY=Newman
set TESTRAIL_PROJECTID=6
set TESTRAIL_SUITEID=23
set TESTRAIL_TITLE="Postman API Tests"

newman运行“ xxx方法(xxx-xxx)QA.postman_collection.json” -e“ xxxx-本地-xxxx.postman_environment.json” -g“ My Workspace.postman_globals.json” --reports cli,testrail; < / p>

错误:-

Error: Server responded to https://xxxx.testrail.io/index.php?/api/v2/get_suite/23 with status code 401:
{"error":"Authentication failed: invalid or missing user\/password or session cookie."}
    at Response.getBody (/usr/local/lib/node_modules/newman-reporter-testrail/node_modules/http-response-object/lib/index.js:41:23)
    at TestRailReporter.handleCompletion (/usr/local/lib/node_modules/newman-reporter-testrail/lib/TestrailReporter.js:45:64)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/newman-reporter-testrail/lib/TestrailReporter.js:17:12)
    at EventEmitter.emit (/usr/local/lib/node_modules/newman/node_modules/eventemitter3/index.js:203:33)
    at done (/usr/local/lib/node_modules/newman/lib/run/index.js:280:29)
    at /usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/backpack/index.js:58:34
    at PostmanCollectionRun._process (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:163:13)
    at PostmanCollectionRun.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:169:76)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  statusCode: 401,
  headers: {
    date: 'Mon, 09 Mar 2020 21:49:23 GMT',
    'content-type': 'application/json; charset=utf-8',
    'content-length': '87',
    connection: 'close`enter code here`',
    server: 'Apache',
    'set-cookie': [
      'tr_session=75d13a24-5317-4888-b97f-3fb08d96ecbd; path=/; samesite=none; secure; HttpOnly',
      'notificationbar=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/index'
    ]
  },

================================================ ===========================================

我已验证我的用户名和API密钥正确无误,并尝试了多次,但没有成功,任何人都可以帮助我确定错误的确切原因。

0 个答案:

没有答案