Forum Discussion
Hello,
Sorry I'm a bit late to the party here. I no longer use testcomplete and testrail, but I'll try to help where I can.
leandropoblet, you posted an image that had an exception message that pointed to the testrail script file, line 86, column 5. Can you please post the statement from that line? I'm guessing it's the
testrail.apiClient().SendPost(apiArgsAsString, dataDictionaryObj);
line.
Next, I would put a debug breakpoint on that statement, and then run the function that you've been testing with. Once TC stops at that line, use the Locals panel and/or the Evaluate dialog to get the apiArgsAsString value and dataDictionaryObj (may have to change the latter into a string or json object). Paste those values and we can go from there. My guess is that apiArgsAsString is not a valid string.
Another place to check would be the client root endpoint is correct
var client = dotNET.Gurock_TestRail.APIClient.zctor("https://testrail.blahblah1234.com/testrail/");
- leandropoblet8 years agoFrequent Contributor
Hi schef, joseph_michaud and Colin_McCrae,
Found the source of the problem thanks to schef's last reply and it has nothing to do with schef's scripts.
TestRail address was incorrect although that wasn't the only problem. Also TestRail has an awkward way to reference test cases in a test run. Using the method add_result_for_case passing runId and caseId it's a bit tricky as the caseId in this case is the test case number (C) not the Test (T) from the test run.
Yes as complicated as it sounds that's the source of the problem. So basically TestRail references a test case in a run using RunId + CaseId instead of RunId + TestId (which is generated for each test run).
Thank you all for the good effort and support as it would have been impossible to get it working without you. Much appreciated.
Cheers,
Leo- leandropoblet8 years agoFrequent ContributorJust FYI I'm folowing up on another threat regarding the get_case method as it returns Json but can't be accessed as such
- Colin_McCrae8 years agoCommunity Hero
"So basically TestRail references a test case in a run using RunId + CaseId instead of RunId + TestId (which is generated for each test run)."
That's what I was alluding to in my "**BRAINWAVE**" post further up. TFS is much the same. A test case always carries it's own ID, which is permanent, but when part of a test run, it carries a Run ID for that run only. Same idea with TestRail. And it makes sense when you stop and think about it. But does make referencing things a little more awkward.
Glad you got it sorted out. :)
Related Content
Recent Discussions
- 2 days ago