I am currently utilizing TestRail API .NET bindings in conjunction with JavaScript and TestComplete CLR bridge functionality. I have developed the Guorok.Testrail library by referencing the Newtonsoft.Json library in Visual Studio. In TestComplete, I can see the TestRail binding APIClient method, indicating that the bridge is functioning properly. However, when trying to log in to the TestRail API via a script in TestComplete, I am encountering an error with the APIClient:
System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.GetResponse()
at Gurock.TestRail.APIClient.SendRequest(String method, String uri, Object data) in D:\Users\qa\Desktop\Gurock DO NOT DELETE\testrail-api-master\dotnet\Gurock\TestRail\APIClient.cs:line 189
at Gurock.TestRail.APIClient.SendPost(String uri, Object data) in D:\Users\qa\Desktop\Gurock DO NOT DELETE\testrail-api-master\dotnet\Gurock\TestRail\APIClient.cs:line 95
While I am able to successfully authenticate via Postman, I am encountering issues when trying to do the same with TestComplete. My goal is to update a test case to 'passed' using the TestRail API within TestComplete's CLR bridge by providing the necessary parameters such as apiArgsAsString, runId, caseId, and dataObj. I have double-checked that the apiArgsAsString is indeed a string, specifically "add_result_for_case/278/43381". Additionally, I have ensured that TestAPI access has been enabled in both the necessary administration settings.
Below is an example of the passCase function:
testrail = {};
testrail.passCase = function(runId, caseId, additionalFields) {
testrail.addStatusAndResultForCase(runId, caseId, additionalFields, 1);
};
testrail.addStatusAndResultForCase = function(runId, caseId, additionalFields, statusId) {
additionalFields = additionalFields || {};
additionalFields.status_id = statusId;
testrail.addResultForCase(runId, caseId, additionalFields);
};
testrail.addResultForCase = function(runId, caseId, additionalFields) {
dataObj = testrail.dataDictonary(additionalFields);
testrail.sendPost("add_result_for_case/" + runId + "/" + caseId, dataObj);
};
testrail.sendPost = function(apiArgsAsString, dataDictionaryObj) {
testrail.apiClient().SendPost(apiArgsAsString, dataDictionaryObj);
};
testrail.dataDictonary = function(jsonObj) {
var dataD = dotNET.System_Collections.Hashtable.zctor();
for (var key in jsonObj) {
if (jsonObj.hasOwnProperty(key)) {
dataD.Add(key, jsonObj[key]);
}
}
return dataD;
};
testrail.apiClient = function() {
var client = dotNET.Gurock_TestRail.APIClient.zctor("myTestRailURL");
client.User = "myUsername";
client.Password = "myPassword";
return client;
};
//USEUNIT
function testUpdateTestRail() {
testrail.passCase(278, 43381, {comment: 'Updated to Passed'});
};
Upon executing the above function, I continue to encounter the SSL/TLS error mentioned earlier. If anyone has encountered this issue before or has successfully integrated TestRail with TestComplete, I would greatly appreciate any guidance or suggestions on what steps to take next!