Help needed - how to integrate robot framework with TestRail (Test Management Tool)

2,512 views
Skip to first unread message

chetan lashkari

unread,
Jun 5, 2015, 5:34:40 AM6/5/15
to robotframe...@googlegroups.com
Hi All,

could anyone please help me how to integrate testrail with robot framework.
Can anyone give me steps to configure it if it possible.

I am very new to this hence help is requirement.

As I know it will pass/fail test case in test rail based on its actual result.

Thanks in advance.

Regards
Chetan

Tatu Aalto

unread,
Jun 6, 2015, 4:54:09 PM6/6/15
to chetan lashkari, robotframework-users

Ugh

I haven't done integration to TestRail but if was doing it, I would look to the listener [1] interface or by using xunit [2] result file.

-Tatu
Send from my mobile
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-listener-interface
[2] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#xunit-compatible-result-file

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Dmitriy Zverev

unread,
Jun 7, 2015, 2:50:13 AM6/7/15
to robotframe...@googlegroups.com
Hello.
You can find my example of TestRail listener here
https://github.com/dmizverev/robot-framework-library/blob/master/listener/TestRailListener.py
It uses TestRail API binding for Python http://docs.gurock.com/testrail-api2/bindings-python

пятница, 5 июня 2015 г., 12:34:40 UTC+3 пользователь chetan lashkari написал:

chetan lashkari

unread,
Jun 8, 2015, 3:17:07 AM6/8/15
to robotframe...@googlegroups.com
Hi Thanks for help but here i would like to tell something unhappening is here

I did same use TestRailListener.py

when running with below arugumets
pybot.bat --listener TestRailListener.py:testrail_server_name:tester_user_name:tester_user_password:20

it is giving no method found becuase of add_results_for_cases as it was supported in api 3.

Then I had given new try and replaced add_results_for_cases to "update_run"
but after running nothing happened.

then I tried with update_run in close method and arguments as
pybot.bat --listener TestRailListener.py:testrail_server_name:tester_user_name:tester_user_password:20:update

again it says error - not a valid case

Could you please help me now in these scenarios.

Regards
Chetan

chetan lashkari

unread,
Jun 8, 2015, 3:21:58 AM6/8/15
to robotframe...@googlegroups.com
sorry few mistake i have done in my last reply.

it requires testrail version 3.1

What testrail api version we have 

TestRail version3.0.1.3030 (update available)
so could please check why it is not updating the status of test case when i am putting update_run in close method.

If i missing something please let me know what is missing!!!



On Sunday, 7 June 2015 12:20:13 UTC+5:30, Dmitriy Zverev wrote:

Dmitriy Zverev

unread,
Jun 8, 2015, 3:38:45 AM6/8/15
to robotframe...@googlegroups.com
I think, that in this case you should use api method "add_result_for_case" in "end_test".


понедельник, 8 июня 2015 г., 10:21:58 UTC+3 пользователь chetan lashkari написал:

chetan lashkari

unread,
Jun 8, 2015, 4:38:37 AM6/8/15
to robotframe...@googlegroups.com
hi

thanks for quick reply i am still getting below error 

running with argument :
pybot.bat --listener TestRailListener.py:testrail_server_name:tester_user_name:tester_user_password:20

[ ERROR ] Calling listener method 'end_test' of listener 'C:\Users\chetanl\workspace\ModeWebTest\src\TestRailListener.py' failed: APIError: TestRail API returned HTTP 400 ("Field :case_id is not a valid test case.")

Please help.

is it necessary to run with update and autotext.txt ??

-Chetan

chetan lashkari

unread,
Jun 8, 2015, 5:02:13 AM6/8/15
to robotframe...@googlegroups.com
i am sorry, i was thinking autotest.txt is some other file, but it is a robot framework file contains test case.

well as i mentioned earlier it is not running same issue:

[ ERROR ] Calling listener method 'end_test' of listener 'C:\Users\chetanl\workspace\ModeWebTest\src\TestRailListener.py' failed: APIError: TestRail API returned HTTP 400 ("Field :case_id is not a valid test case.")

Though my test case id is valid.

I will give screenshot as in attachment.

-Chetan
TestRail.png

Dmitriy Zverev

unread,
Jun 8, 2015, 5:13:45 AM6/8/15
to robotframe...@googlegroups.com
No, its not case_id its test_id. Case_id starts with "C", for example: "C46203", so you need "[Tags]    testrailid=46203"
Case_id does not change in different  test_run,therefore it is necessary to specify it

понедельник, 8 июня 2015 г., 12:02:13 UTC+3 пользователь chetan lashkari написал:

chetan lashkari

unread,
Jun 8, 2015, 5:18:34 AM6/8/15
to robotframe...@googlegroups.com
oh is it !! so run id is correct ?

Thanks for correcting me.

chetan lashkari

unread,
Jun 8, 2015, 5:21:15 AM6/8/15
to robotframe...@googlegroups.com
awesome man... thanks alot for your priceless help :) happy now.

one last question, i hope i didnt irritated you.

How do i run it for multiple test cases.

I really appreciate, please let me know if i can help you anytime.

-Chetan

chetan lashkari

unread,
Jun 8, 2015, 5:43:26 AM6/8/15
to robotframe...@googlegroups.com
I understand it as well, if need to run for mutiple test case then in each test case i need to put a line

[Tag]     testcaseid=123434 and so on

but in case of test fail/pass, if need to set test result as in comment, how would i do it ??

Thanks
Chetan

Dmitriy Zverev

unread,
Jun 8, 2015, 8:40:50 AM6/8/15
to robotframe...@googlegroups.com
> [Tag]     testcaseid=123434 and so on
yes, right


> but in case of test fail/pass, if need to set test result as in comment, how would i do it ??
In this case error message from robot framework displayed in TestRail
Try insert in robot test:
Fail    My test message

понедельник, 8 июня 2015 г., 12:43:26 UTC+3 пользователь chetan lashkari написал:

Valtteri Enstedt

unread,
Aug 17, 2017, 3:09:32 AM8/17/17
to robotframework-users
I'm trying to get the TestrailListener to work as well. I keep getting two errors when I run a test set with it:

[ ERROR ] Calling method 'end_test' of listener 'TestRailListener' failed: TypeError: 'TestCase' object has no attribute '__getitem__'
and
[ ERROR ] Calling method 'close' of listener 'TestRailListener' failed: APIError: TestRail API returned HTTP 400 ("Field :results cannot be empty (one result is required)")

Yes, it doesn't seem to get the results, but I haven't figured out why. Any pointers are welcome.

Thanks,
Valtteri

Kashif Shehzad

unread,
Jan 20, 2018, 6:04:45 PM1/20/18
to robotframework-users
Hello Chetan,

I need some help with integration of TestRail with Robot. Could you please?
Thanks!

Gary Fung

unread,
Mar 2, 2018, 1:19:36 PM3/2/18
to robotframework-users
I'm facing the same issue as Valtteri and getting. Has anyone figured out how to avoid getting these errors?
[ ERROR ] Calling method 'end_test' of listener 'TestRailListener' failed: TypeError: 'TestCase' object has no attribute '__getitem__'
and
[ ERROR ] Calling method 'close' of listener 'TestRailListener' failed: APIError: TestRail API returned HTTP 400 ("Field :results cannot be empty (one result is required)")


Message has been deleted

phaneendra kumar Gondi

unread,
Oct 4, 2018, 10:29:20 AM10/4/18
to robotframework-users


On Thursday, 4 October 2018 15:28:50 UTC+1, phaneendra kumar Gondi wrote:
I'm getting below issue please help on how to resolve

 ERROR ] Taking listener 'TestRailListener.py:testrail_server_name:tester_user_name:tester_user_password:20' into use failed: Importing listener 'TestRailListener.py' failed: Module 'TestRailListener' does not contain 'py'.

Thank you
P

Валентин Розловенко

unread,
May 9, 2019, 10:31:53 AM5/9/19
to robotframework-users
remove py from TestRailListener so edited line will look like this :
TestRailListener:testrail_server_name:tester_user_name:tester_user_password:20



четверг, 4 октября 2018 г., 17:29:20 UTC+3 пользователь phaneendra kumar Gondi написал:

Валентин Розловенко

unread,
May 9, 2019, 10:31:53 AM5/9/19
to robotframework-users
Hi to all right now robotframewok 3 is released with python3 support has anyone tryed to port that code into python3 ? 


пятница, 5 июня 2015 г., 12:34:40 UTC+3 пользователь chetan lashkari написал:
Hi All,

kanagaraj S

unread,
Mar 9, 2020, 9:52:45 AM3/9/20
to robotframework-users
Hi 
I am suppose to integrate TestRail with RobotFramework.
Could some one share the steps or guide or documentation to proceed further

Thanks
Kanagaraj S
Reply all
Reply to author
Forward
0 new messages