Picture4 2 1

RTM Test Management Automation Comprehensive Guide

3 Comments

Introduction of RTM Test Management

The process of tracking and managing requirements across the software development lifecycle, especially in relation to testing, is known as RTM (Requirement Traceability Matrix) test management. To make sure that every need is appropriately validated through testing, a matrix mapping requirement for test cases must be created.

In RTM test management, the matrix typically includes the following components:

Requirements: All the requirements for the software that is being developed are listed in this section. Functional specifications, user stories, use cases, and other documentation describing the functions the software should perform can all be considered requirements.

Test Cases: To validate each requirement, related test cases are created. Test cases specify the procedures to be followed, the desired result, and any circumstances that must be met for the test to be carried out.

Test Plan: Every testing procedure needs a test plan, which should contain all relevant test cases as well as, tangentially, the requirements. This indicates that test plans provide a summary of every step taken during the testing process. This guarantees comprehensive coverage of the software’s functioning and the testing of all requirements.

Test Execution: The process of carrying out test plans and tracking the outcomes of test case execution is known as test execution. The structure of the test plan and test execution are the same. It includes a list of test cases with an execution status indicator, so you can keep an eye on it. Test execution may also be delegated to a specific individual.

Defects: A defect is a flaw or error that shows up while the test is running. The tester creates a defect after discovering such flaws during test case execution. Defects impact the entire test case.

Reports: RTM test management supports 4 types of report generation.

  • Traceability: Using a many-to-many relationship comparison, the traceability matrix shows the correlation between any two baselined requirement categories. The types of links that appear in the traceability matrix can be customized.
  • Coverage Report: In this requirement coverage report, you can monitor if requirements are met or not by Test Cases, Test Plans, Test Executions, Test Case Executions, and Defects for a specific Project, Issue Type, Fix Version, Component, RTM Environment, Assignee, and Labels using the Requirement Coverage Report.
  • Test Case Execution Report: In this report, you can monitor the status of test case executions in a certain project, test execution folder, execution plan, RTM environment, and for a specified TCE Created Date and TCE Assignee.
  • Test Execution: This report presents the state of the test cases, their general development, and specific details about the chosen test plan, execution, TCE RTM environment, TCE create date, and TCE assignee.

For additional information, go to

https://deviniti.com/support/addon/cloud/requirements-test-management/latest/overview/

Benefits of RTM test management

RTM test management offers the following advantages:

Enhanced Visibility: It is now simple for stakeholders to monitor the testing process and make sure that all requirements are being suitably validated.

Risk Mitigation: RTM assists in detecting possible gaps or inconsistencies in the software requirements early in the development process by connecting requirements to test cases.

Compliance: By proving that every need has been thoroughly examined and verified, RTM guarantees adherence to legal obligations.

Efficiency: By offering an organized method for handling requirements and test cases, it simplifies the testing procedure and lowers the possibility of missed or duplicate tests.

Step-by step RTM test execution Automation

In this blog we will explore how we can fully streamline test execution automation for RTM test management. The automation is very simple and short. The RTM provides REST API endpoints for managing test cases and importing execution results from automated processes. We will use ‘python’ request module for this automation, you can use any language tool which support HTTP requests.

The step-by-step guide

  • First, you need to generate a token provided by RTM, it is not the same as the Jira token. Only admin users of RTM can create tokens for other users.
  • If you are not an admin user of RTM, please contact the admin user who can create the token for you. The generation of token is thoroughly described here: https://deviniti.com/support/addon/cloud/requirements-test-management/latest/authentication/
  • Now check your base URL to send a request, open your RTM app, click on the three dots on your right-side top corner, and then go to REST API authentication.
RTM
  • Copy the API URL base. The API URL should be as below, as per the location.
Picture2 2
  • Create a sample test plan and add some test cases to it.
  • Now execute the test plan to create test-executions. After this step, you are ready to update the test results using automation.
  • Download and install python from https://www.python.org/downloads/
  • Install ‘requests’ module of Python, which simulates the GET, PUT, POST, etc. HTTP commands.
    • pip install requests
  • The REST API for RTM test management supports bearer token authentication. So the token created earlier needs to be used for authentication purposes.
  • Below is the Python token for bearer authentication.
class BearerAuth(requests.auth.AuthBase):
    def __init__(self, token):
        self.token = token

    def __call__(self, r):
        r.headers['Authorization'] = 'Bearer ' + self.token
        return r
  • Create a class e.g. APIClient with the functions to support GET, PUT HTTP request as below.
class APIClient:
    def __init__(self, base_url, jwt_token):
        self.token = BearerAuth(jwt_token)
        if not base_url.endswith('/'):
            base_url += '/'
        self.__url = base_url + 'api/v2/'

    def send_get(self, uri):
        """Issue a GET request (read) against the API.
        Args:
            uri: The API method to call including parameters, e.g. test_key.
        """
        url = self.__url + uri
        token = self.token
        response = requests.get(url, auth=token, timeout=30)
        return response

    def send_put(self, uri, data):
        """Issue a PUT request (write) against the API.
        Args:
            uri: The API method to call, including parameters, e.g. test_key.
            data: The data to submit as part of the request as json
        """
        url = self.__url + uri
        token = self.token
        response = requests.put(url, auth=token, json=data, timeout=30)
        return response
  • Create an instance of the class using below function, pass the base API URL and authentication token
def get_client(JWT_TOKEN):
    client = APIClient(base_url, JWT_TOKEN)
    return client
  • To use the REST API, you need to pass the test key combination of test plan and case id.
Picture3 2
  • To update the test result first initiate the client with the token.
client = get_client(JWT_TOKEN)
  • Create the remaining URL in accordance with the RTM-supported REST API.
test_execution_id = 'test-case-execution/' + test_plan + '-' + testid
  • Create the JSON data now based on the status value. Below are supported.
Picture4 2
  • The json data
data1 = {
  "testKey": test_plan + '-' + testid,
  "actualTime": 123,
  "environment": "Chrome",
  "result": {
    "id": 123,
    "name": "name",
    "color": "#FFFFFF",
    "finalStatus": True,
    "statusName": ‘Pass’
  }
}
  • Update the test result using HTTP PUT
response = client.send_put(test_execution_id, data)
  • For success, a 204 status code will be returned.
  • Verify in your RTM browser that the mentioned test case should be updated as per your result. Use the code for every script you develop for a test case.

3 Replies to “RTM Test Management Automation Comprehensive Guide”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts