Subscribe Join 180,000+ subscribers and receive articles from our blog about software quality, testing, QA and security. Subscribe

Newman and testrail integration issue

When i run the my postman testcases in newman i am getting the below error. I have setup all the Environment varaibles. I am running it on my local windows machine and trying to update the testrail test cases in free trail Testrail cloud project. I have given the proper suite id which is S2

Error:
C:\Users\93001414\AppData\Roaming\npm\node_modules\newman-reporter-testrail\node_modules\http-response-object\lib\index.js:51
throw err;
^

Error: Server responded to https://testrailintegration.testrail.io//index.php?/api/v2/get_suite/S2 with status code 400:{“error”:“Field :suite_id is not a valid ID.”}
at Response.getBody (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman-reporter-testrail\node_modules\http-response-object\lib\index.js:41:23)
at TestRailReporter.pushToTestrail (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman-reporter-testrail\lib\TestrailReporter.js:209:64)
at TestRailReporter.onComplete (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman-reporter-testrail\lib\TestrailReporter.js:38:12)
at EventEmitter. (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman-reporter-testrail\lib\TestrailReporter.js:7:12)
at EventEmitter.emit (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman\node_modules\eventemitter3\index.js:203:33)
at done (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman\lib\run\index.js:293:29)
at C:\Users\93001414\AppData\Roaming\npm\node_modules\newman\node_modules\postman-runtime\lib\backpack\index.js:58:34
at PostmanCollectionRun._process (C:\Users\93001414\AppData\Roaming\npm\node_modules\newman\node_modules\postman-runtime\lib\runner\run.js:163:13)
at PostmanCollectionRun. (C:\Users\93001414\AppData\Roaming\npm\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: 400,
headers: {
date: ‘Wed, 12 Aug 2020 20:38:18 GMT’,
‘content-type’: ‘application/json; charset=utf-8’,
‘content-length’: ‘46’,
connection: ‘close’,
server: ‘Apache’,
‘set-cookie’: [
‘tr_session=cbe9d7fb-a69e-4d08-bd36-c31c03c42cca; path=/; samesite=none; secure; HttpOnly’,
‘notificationbar=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/index’
]
},
body: Buffer(46) [Uint8Array] [
123, 34, 101, 114, 114, 111, 114, 34, 58,
34, 70, 105, 101, 108, 100, 32, 58, 115,
117, 105, 116, 101, 95, 105, 100, 32, 105,
115, 32, 110, 111, 116, 32, 97, 32, 118,
97, 108, 105, 100, 32, 73, 68, 46, 34,
125
],
url: ‘https://testrailintegration.testrail.io//index.php?/api/v2/get_suite/S2
}

Appreciate your help.

Although the entity id for the Suite “S2” is correct, using the API you should only provide a “2”.
The same for cases, test, runs etc…

Good for the UI to recognize it in one term, but within the DB only the pure numeric Id is stored.

Try this:
https://testrailintegration.testrail.io//index.php?/api/v2/get_suite/2