Robot Framework Integration with TestRail

robot framework integration with TestRail

Robot Framework Integration with TestRail

What is TestRail?

TestRail is a test case and test management programming device that can be coordinated with Jira. In easy language, TestRail is the application used to compose the experiments in the proper arrangement. It’s the combination of sophisticated project management capabilities with features and mostly used by the QA and Development teams to manage the functional, exploratory, and automated tests. TestRail tool plays a so crucial role to organize your QA department and track software testing efforts.

Whats is the benefits of  Robot Framework Integration with TestRail

  • Web-Based
  • Integration with Jira
  • Versatility
  • User-Friendly
  • Easy use of multiple testing Methods

There 3 ways to save test case execution results into the TestRail by using:

  a) Testrail Binding,
  b) Testrail Listener,
  c) Testrail API with the help of references.

Here, in our blog, we are using a TestRail listener to do so.

Prerequisites:

  • Enable TestRail API for your project: Navigate to TestRail > Administration > Site Settings > API menu and enable API.
  • Install Robot Framework TestRail library using the below command:

               pip install robot framework-testrail

  • Remove TestRail from the path in URLs:

                     <python folder path>/Lib/site-packages/TestRailListener.py         testrail_url

                     <python folder path>Lib/site-packages/TestRailAPIClient.py       self._url

  • Create a TestRun into TestRail by including all those tests which you want to run and save results.
Introduction to WinAPpDriver - Free Automation Testing Tool

Link Test Cases:

To submit test results from Robot Framework Integration with TestRail, you need to link a test case from Robot Framework to the one in TestRail. In order to do that, Create a tag named restrained in each test case of the robot framework to store related TestRail test case ID. This tag should store numbers only. For example, if you have a test case with ID C1929, the variable should be filled with 1929.

  So tag will be testrailid=1929

  Example:

*** Test Cases ***

Open Gmail

    [Tags]  testrailid=1929

    Open Browser https://www.gmail.com chrome

    [Teardown]    Close Browser  

Run Tests using listener:

pybot –listener TestRailListener.py:testrail_server_name:tester_user_name:tester_user_password:run_id:https:update  robot_suite.robot

Share this post