Ask a Question

Integration TestRail and TestComplete

SOLVED
Sundaytwins
Occasional Contributor

Integration TestRail and TestComplete

Hi, Is there anyone who has succesfully integrated the TestRail API into TestComplete?

 

I'm working with the VBScripts in TestComplete, but was not yet able to report my results back to TestRail using the TestRail API.

 

In fact, I'm not even getting close to getting the TestRail API working in my scripts.

 

Thanks in advance!

20 REPLIES 20

Hi,

 

HTTP status 200 means that sent request succeeded.

Nothing is expected to be opened because you are dealing with plain TestRail's API, but not TestRail web application itself.

The thread referenced above (https://community.smartbear.com/t5/TestComplete-General-Discussions/TestComplete-integration-with-Te...) contains pretty good description and code snippets.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
ArtyrMartyr
New Contributor

Good afternoon!

I figured out how to put the results in TestRail through the API.
I can not understand how to run tests through TestRail? Has anyone done this?

Thanks for any answer.

I use TestComplect 10.50

Sundaytwins
Occasional Contributor

Hi, 

 

I created a framework in Testcomplete that will read the tests inside a test run with a given test run-id.

Then, it would execute the corresponding test cases as read from the test run.  

At the end of each test case execution, the result of the test was returned via the API into TestRail.

 

As far as i know, there is no possibility to 'start' a test run or test case execution from within TestRail towards a (connected) Testtool.


Hope this helps. 

 

I'm gladly willing to share the framework as it is built in Testcomplete. (12 i believe, it has been a while... )

 

Good luck!

@Sundaytwins, Thank you.

I will try to configure the launch of tests from TestRail. If I can write here 🙂

@Sundaytwins:

Hi,

 

> I'm gladly willing to share the framework as it is built in Testcomplete.

While SmartBear has not provided yet an area for solutions sharing (though they are considering this), you may contact @tristaanogre and talk to Robert to include your solution into the set of TestComplete-related goodies (https://bitbucket.org/account/user/privateteamogre/projects/CSE).

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

Dear SundayTwins,

 

Just wondering if you have published your framework anywhere yet ?

If your framework based on TestComplete's script extension ?

 

Thanks

aaron

sachinmk08
New Contributor

HI SundayTwins ,

 

Let me know if you were able to load this framework. I am trying to use the TestRail Api's to load the test results.

 

Thanks

Sachin

"At the end of each test case execution, the result of the test was returned via the API into TestRail."

 

I would be interested to know how you can determine the pass/fail status of a test at the end of its execution. 

Because the test log is not generated(e.g., RootLogData.dat) until after all test items have been executed.

 

Someone suggested ErrCount object but unfortunately this property is not tied to a specific test items but it's accumulative.

Eduardo
New Contributor

I know it is tooo late for answering but I hope someone will find this information useful. 

I was setting the integration between TC and TestRail and solved problem of saving results of each test this way: 

 

I added 2 global variables to project: 

Project.Variables.currentTestName = {testName}; // for example 1788
Project.Variables.currentTestStatus = 0;

 

And include them into each test. Each test has at the start

Project.Variables.currentTestName = {testName}; // for example 1788
Project.Variables.currentTestStatus = 0 

 

and at the end

Project.Variables.currentTestStatus = 1 

 

If test failes, status remaines 0.

 

To use these variables I created OnStopTest event - it works either test passes or failes. 

Code in the event looks like this: 

let caseId = Project.Variables.currentTestName;
let caseStatus = Project.Variables.currentTestStatus;
let testRailClient = new TestRailClient.TestRailClientClass(); 
testRailClient.sendResult(caseId, caseStatus);

 

Hope someone will find this useful. 

Thank you @Eduardo !

Is there any way you can also share the class you are using here:
let testRailClient = new TestRailClient.TestRailClientClass(); 

cancel
Showing results for 
Search instead for 
Did you mean: