Katalon Studio Integration with TestRail


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/tutorials/katalon-testrail-integration.html

Hello Nikita,
First of all, thank you for such great tutorial!
I am a bit stuck on the last step.

WebUI.callTestCase(findTestCase('%replace this with path to your test case, for example:_nb/sync/testrail -- update run tc results%'), [:], FailureHandling.CONTINUE_ON_FAILURE)
}

Where to find this path?

I am taking a wild guess and guess that they are asking to place the path where all of your test cases are:

/call test case using WebUI Class
WebUI.callTestCase(findTestCase("Test Case ID"}), ["key1":"value1", "key2":"value2", … , "keyN":"valueN"], FailureHandling.OPTIONAL)

Test Cases/LoginUser

@alex.perez @ivy This is the path of test case creating for “communication between Katalon Studio and TestRail”. Second last step mentioned in document. lets say the name of test case is TestRail

WebUI.callTestCase(findTestCase(‘TestRail’), [:], FailureHandling.STOP_ON_FAILURE)

Thanks
Ashwin N.

I’m having problems with this code
for (def n : (0…response[“id”].size)) {
if ((response[‘case_id’])[n].toString() != ‘null’) {
tcs_to_add.add((response[‘case_id’])[n].toString())
}
}

I got this:

groovy.lang.MissingPropertyException: No such property: size for class: java.lang.String

Does someone managed to get this tutorial up and running?

Thanks,
Darius

I’ve been close yet so far :frowning: Quite confusing this guide and not really clear on what needs doing. I’ve managed to run this test however it fails on the last AfterTestSuite case.

For the problem you are having, I assume it’s for the first part to get_tests in the long code? If so, this would be because your test doesn’t know where the get_tests lives so in the def response = CustomKeywords, you need to tell it where to look i.e.:

For me Testrail is the name of the .groovy file inside Keywords folder. Let me know how you get along.

Thanks for the reply. The place of the keywords is ok, and they are referenced correctly. The problem that I have is that for "for (def n : (0…response[“id”].size)) " there is no .size property. Please see attached screenshot.

Thank you,
Darius

Getting error for code:
tc_ids = getTestCaseVariables()[“testrail_tc_id”].split(",")

Hi @apurva.sonak

Can you send us the full log. The error indicates that you are trying to call a function that doesn’t exist. For example, there is no method split() on an Integer type.

Regards !

Hi Guys,

Please see the following forum I’ve written with instructions on Katalon and TestRail Integration:

I hope the above is clear to understand and easy to follow. Do post any questions and issues on that forum.

Thanks,
Jay

3 Likes

Hi @darius,

I have to ask. Were you able to fix the “for (def n : (0…response[“id”].size))” error that you got last February 1?
I’m in the same boat. :sweat_smile:

Jason

Just FYI - we’ve built a TestRail integration plugin for Katalon Studio. If you have any feedback or suggestions we are happy to hear from you.

https://store.katalon.com/product/13/TestRail-Integration

2 Likes

Hi @devalex88, I have a problem with the integration of Katalon with Testrail. I have followed the documentation exactly. However, Testrail does not process the summary of the output of Katalon’s test suite. A new Test run is generated in Testrail, but the data after export in Katalon is not processed. Do you have any suggestions?

To enable the integration of Katalon Studio with TestRail, you need to:

In TestRail
Log in to your account > Administration > Site Settings > API > Enable API > Save Settings.

In Katalon Studio
Enable TestRail Integration plugin in Project Settings:
After installing and reloading the plugin, open Katalon Studio > from Katalon Studio menu bar > Project > Settings.
In the Project Settings window > Plugins > TestRail > Check Using TestRail to enable the integration.
Enter the credentials required for Authentication:
URL: your TestRail instance https://.testrail.io.

Username: your TestRail Username.

Password: your TestRail password.

Project: Specify the TestRail project’s ID (an integer) you’d like to integrate with Katalon Studio.

To view the project ID, open your project in TestRail > view the TestRail Project URL.

Click Test Connection and then OK.

Hi Lewis-H,
This is clear and is one of the first steps. My problem is in one of the last steps in TestRail. TestRail does not process the results. I am getting a 400 bad request.
Thanks for respons,
Heidi

Lewis-H,
I have done the following steps . 1. Plugin installed (connection succeeded), 2. Open a project in TestRail and test cases created, 3. In Katalon the number of the test cases linked, 4 in TestRail created a test run with specific test cases, 5. In Katalon test performed (name starts with S1 ). 6. In TestRail a run is created with S1 in the name. However, the results are not processed in TestRail . I think here’s the problem here. But can’t find any information about it.
Heidi

Hi @Lewis-H @devalex88
I think my problem has been solved. I had to fill in a result_field which I didn’t. I unchecked and then TestRail displayed the correct result. Thank you for the quick response and the effort you have put in. Hopefully I will enjoy the integration of TestRail in Katalon, I am very happy with it.
Heidi

3 Likes