Integrate TestLink with an Automation Framework

TestLink, one of the famous open-source web-based test-case management tool in the software quality assurance industry. Couple of year ago, I was granted to work along with the tool to not only to manage test-cases, but also to integrate the test-link with the organizational automation framework.

Integration was not an easy task at all initially as there was no proper step-by-step guide to configure, code and setup the integration. Therefore this post is written with the initiative of guiding and assisting anyone who could face the challenge.

Regardless of the test methodology, as either BDD (Behavior Driven Development) or TDD (Test Driven Development) from each of the test method or the test scenario the test class should interact with the testlink API.
Therefore the testing framework can be Cucumber, TestNG, JUnit, or etc.

But, based on the chosen testing framework the listener of the testing framework has to be overrides by the customized listener class to invokes upon the test result state change.

Upon invoking the customized listener from the test method/scenario, the test result state should pass to the Testlink API (TL-API) to update the test case status in TestLink. To bridge the customized listener and the TL-API, an intermediate class is necessary to construct (TestLink Interactor class according to the above diagram). Consider it the most crucial commitment in the integration process as the customized listener bridges with the API.

Once the intermediate class in constructed, the listener methods (onSuccess, onFail, etc) should be constructed to interact with the intermediate class. The intermediate class or the integration class should be capable of dealing with the ‘iTestResult’ object which carriers the test result details and to pass towards the TL-API.

To establish the bridge in between and create a successful handshake an API key is essential to be defined from the automation framework or from the interactor class, along with the hosted endpoint URL. The API Key must be generated from the hosted Testlink, as its key to walk through your hosted Testlink for your automation framework.

Ps: Always ensure the Execution Type of test cases are configured as ‘Automated’ instead of its default pick ‘Manual’ in Testlink.

Research/Development presentation conducted to the workplace : slideshare.com/hirosht/testlink-integrator

Writer | Vlogger | Techie | Technical Tester (Snr-QAE)