Experiencing an issue with establishing a secure SSL/TLS connection while utilizing Test Complete CLR Bridge alongside TestRail .Net bindings

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!

Answer №1

The challenge did not stem from the code provided above, leading me to make adjustments to the TestRail .NET API bindings using the following code snippet:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

For additional insights, visit: The request was aborted: Could not create SSL/TLS secure channel

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Function not being triggered by button

We are struggling to get a button to trigger a function upon being clicked. Is there a reason why the function is not being called? <body> <button onclick="instagramclick()">Login to instagram</button> <button onclick="myFunction( ...

What is the reason `addEventListener` does not work with a class method?

Recently, I discovered that the listener passed to addEventListener can actually be an object with a handleEvent function instead of just a callback function (here). However, I encountered an issue when trying to use handleEvent as a class method: class F ...

button for resetting the zoom in Highcharts

Attempting to manipulate the visibility of the Zoom Button on a highstock chart through x axis zooming with the navigator feature enabled. The default behavior seems to disable the button in this scenario. While there are functions allowing for display, I ...

Using 'void' as a generic argument

My code consists of a base class with a common function: class MyBaseClass<TOut> { public abstract TOut MyFunc<TOut>(); } Along with specific implementations: class MyDerivedClass : MyBaseClass<string> { public override strin ...

The divs are crashing into each other and moving at varying speeds

I have created a mini game inspired by diep.io on codepen, where you can upgrade your reload and shooting capabilities. However, I have encountered an issue where the bullets start moving at different speeds and end up overlapping each other after shooting ...

Changing JSON into an array with typescript

I have encountered a JSON structure that is causing me some trouble: const help = [ { "en": [ { "test2": [ { "title": "Naslov1", &quo ...

Is there a way for me to determine the component I was in?

Currently, I am utilizing vue js for a project where I have draggable component items. These components are generated using a for loop to display them. My question is, how can I detect which component I am currently on when I click on it? Here is a snippe ...

The nested click event is not functioning as expected

Below is a simplified version of HTML code containing 2 nested click events (one on the href and one on an input). When the user clicks on the input field, it inadvertently triggers the javascript function SelectTable() linked to the href event. This unint ...

The JSONP request connected to the user input field and button will only trigger a single time

Hello all, I'm new to this and have been searching the internet high and low to see if anyone has encountered a similar issue before, but haven't had any luck. I've been attempting to set up a JSONP request to Wikipedia that is connected to ...

Gain a comprehensive understanding of the JavaScript syntax utilized throughout the code

I stumbled upon this JavaScript code that enables asynchronous file uploads, but there are certain parts of it that I'm struggling to grasp. Any insights or explanations would be greatly appreciated - many thanks in advance. // Utilizing Ajax for Fil ...

The child div can be scrolled horizontally, while the parent window remains fixed

I am facing a challenge with my HTML and CSS setup. I want to create a child div that scrolls horizontally, but I do not want the parent window to scroll along with it. Below is my current code: <div id="parent"> <div id="div1"> . ...

Expanding the width of CSS dropdown menus according to their content

When attempting to create a dynamic dropdown menu, I encountered an issue where the values were skewed in Internet Explorer if they exceeded the width of the dropdown. To fix this problem, I added select:hover{width:auto;position:absolute}. However, now th ...

Automatically modify browser configurations to disable document caching

Is it possible to prevent browsers from caching pages using JavaScript? I've noticed that even though PHP has a redirection implemented once the user logs in, when they press the browser's history button, it goes back to the login form. This is b ...

Addressing simple JavaScript "async" AJAX requests that are sequenced and reliant on each other

I'm currently developing an application that includes a dashboard on its main page. In order to address any potential loading issues, the content of the dashboard is being calculated asynchronously using Ajax. This means that users do not have to wait ...

Animate CSS with Javascript in reverse direction

Forgive me if this is a silly question, but I'm having trouble. I need a slide-in navigation menu for smaller screens that is triggered by JavaScript. Here is what I currently have: HTML <nav class="responsive"> <ul class="nav-list unstyl ...

Creating a unique field button in AngularJS that is dynamically generated and specifically targeted as the last button

Is there a way to enable the plusSign = true option only for the last item in the dynamic input field? (function() { var app = angular.module('managementApp', []); // var app = angular.module('managementApp', ['ngRoute' ...

Display a confirmation modal before triggering $routeChangeStart in AngularJs, similar to the window.onbeforeunload event

When a user chooses to stay on the page as the route starts to change, the original route remains intact but the form directives are reloaded. This results in the loss of all checkbox and input values, resetting them to their defaults. If a user closes th ...

"Trouble with jQuery not being triggered when there is a string in

New to the world of MVC and diving into jQuery for the first time, I am faced with a challenge. My goal is to populate text boxes in a partial view using jQuery that is placed within the parent view. Here are the relevant sections of the parent view: @ ...

How can you effectively structure SQL queries for maximum efficiency?

There are multiple SQL queries stored as strings in our code: public class Query { public static string CreditTransferId(string expectedValue, string table, int statusId, int messageTypeId, int destination103, int destination202, string StoreStatu ...

Retrieving live information from an API in order to populate a specific route

Utilizing the contents of two crucial files to extract data from separate APIs, here is my simplified example: poloniex.js const Poloniex = require('poloniex-api-node') const poloniex = new Poloniex() async function obtainExchangeData() { po ...