TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

TestLink Tutorial

TestLink REST API Guide

Most Visited, TestLink Tutorials

Overview

In this TestLink REST API guide, we will learn how to execute TestLink Rest API requests and some sample API endpoints. REST stands for Representational State Transfer. REST allows interaction with systems that are built on HTTP standard protocol. REST is an alternative to legacy systems that are built on SOAP(Simple Object Access Protocol).

Pre-requisites

  • TestLink Web instance up and running

To execute API calls, we need to have the Testlink Web application up and running without any issues. Log in as the API user into the TestLink web application.

  • Install Slim Framework on TestLink instance

https://www.testingdocs.com/install-slim-framework-on-windows/

CRUD Operations

CRUD stands for Create, Read, Update, and Delete. These are the major operations that API calls perform on the server-side resources.

The analogous REST verbs for these operations are as follows:

  • Create -> POST method.
  • Read -> GET method.
  • Update -> PUT method.
  • Delete -> DELETE method.

 

 

CRUD Operations

Manual API Test Tool

We use Postman for testing and executing the REST API calls. A quick overview and download steps can be found at:

https://www.testingdocs.com/postman-api-tool/

TestLink REST API Versions

Testlink versions:

The current version of TestLink is 1.9.x. The upcoming version of the TestLink is 2.x

API versions are different from the Testlink web versions. There are multiple versions for the API endpoints, like.

  • v1
  • v2
  • v3

We need to specify the version in the REST endpoint URL to hit the particular version.

http://<server_testlink_home>/lib/api/rest/v1/who

http://<server_testlink_home>/lib/api/rest/v2/who

 

 

TestLink REST API Versions

Anatomy of API Request

Below is a API request executed to get the project’s information. Let’s understand the API request shown.

 

TestLink API Request

1- API endpoint. The server listens to the API request on this endpoint. Testlink might have many exposed endpoints each for a specific purpose.

2- HTTP method for the request. The shown call is a GET call.

3- Authorization – We need to specify the APIKEY

4- Request Headers for the API request. Content Type, Accept etc.

5 – Response code – 200 OK means Success.

6 – Response Body received from the TestLink server.

Execute a Sample API call

https://www.testingdocs.com/how-to-execute-rest-api-call-using-postman/

Advantages

Rest API allows us to interact with TestLink interaction in an automated fashion.

API opens doors to the integration with other components like Mantis BTS, Jira, etc.

Debugging API errors

https://www.testingdocs.com/questions/how-to-fix-slim-application-error-in-testlink/

https://www.testingdocs.com/questions/how-to-fix-400-bad-request-error-in-testlink-api/

Sample API calls

http://localhost/testlink/lib/api/rest/v2/who

This API is just to check the Rest API status. If you get a 200 OK response status the Rest API setup is fine on the TestLink instance. Any other response code would need attention and debug.

 

 

http://localhost/testlink/lib/api/rest/v2/whoAmI

This API is just to check the Rest API status. If you get a 200 OK response status the Rest API setup is fine on the TestLink instance. Any other response code would need attention and debug.

 

http://localhost/testlink/lib/api/rest/v2/testprojects

 

This API call is used to Gell all the test projects created on the TestLink instance.

Sample REST API Response:

{
"status": "ok",
"message": "ok",
"item": [
{
"id": "1",
"notes": "<p>www.TestingDocs.com</p>",
"color": "",
"active": "1",
"option_reqs": "0",
"option_priority": "0",
"option_automation": "0",
"options": "O:8:"stdClass":4:{s:19:"requirementsEnabled";i:1;s:19:
"testPriorityEnabled";i:1;s:17:"automationEnabled";i:1;s:16:
"inventoryEnabled";i:0;}",
"prefix": "TDocs",
"tc_counter": "0",
"is_public": "1",
"issue_tracker_enabled": "0",
"code_tracker_enabled": "0",
"reqmgr_integration_enabled": "0",
"api_key": "7eb55806c7f7e8ccc83ce4b5b807c9866e5baba05430306f2525296d55db752b",
"name": "TestingDocsProject",
"effective_role": "8",
"itname": null,
"ittype": null,
"rmsname": null,
"rmstype": null,
"opt": {
"requirementsEnabled": 1,
"testPriorityEnabled": 1,
"automationEnabled": 1,
"inventoryEnabled": 0
}
}
]
}

 

Rest API Automation Tool

https://www.testingdocs.com/rest-api-automation-with-karate-automation-tool/

More information on TestLink Open source Test management tool can be found on the official website at: http://testlink.org

Related Posts

TestLink Bitnami Cloud Image

TestLink Tutorial /

TestLink Bitnami Cloud Image

Apache Server Configuration

TestLink Tutorial /

TestLink REST API Apache Server Configuration

TestLink Install on Domain

TestLink Tutorial /

Install TestLink Software via CPanel Platform

Test Suite Import Export TestLink

TestLink Tutorial /

Import/Export TestSuite in TestLink

TestLink Tutorial /

Commercial Alternatives to TestLink Tool

‹ How to fix blank page TestLink __autoload() is deprecated, use spl_autoload_register()› TestLink API

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version