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

Unable to update testrail using Protractor


#1

I am trying update results in testrail using protractor.
Here is the code - I did not get any error. The results are not updated either.

var TestRail = require(“testrail-promise”);
var tr = new TestRail(“https://proj.testrail.net”, "user@domain.com", “pw”);
var obj = {
“project_name”: “Pone”,
“plan_name”: “PlaneOne”,
“run_id”:“R11121”,
“case_id”: “C77761”,
“status_name”: “passed”,
“custom_buildno”:“B991”
};
tr.addResultForCase(obj).catch(function(err){
console.log("ERROR >> " + err);
}).finally(function(res)
{
console.log("enterd into block " + res);
});


#2

The Run and Case ids are only numeric - the R and C is not part of the actual ID. And if you are trying to update a Test Case within a Test Run, then you do not use the original CXXXX id number. When a Test case is added to a run a copy is made and in the UI it shows as TXXXX where the XXXXX part is a new ID.


#3

Thanks a lot for your help!
I was able to update results, though this answer did not resolve the issue directly, it did lots of help to understand the underlying concepts of testrail API workings
Thanks a lot!