API Automation Testing using Tricentis TOSCA: Overview of APIs and JSON Methods

API Automation Testing using Tricentis TOSCA

Table of Contents

Introduction

APIs play a crucial role in connecting different applications and enabling them to work seamlessly together. Knowing how to efficiently test APIs is a crucial skill for testers and QA professionals. API Automation Testing using Tricentis Tosca provides a powerful, codeless, model-based framework for testing both REST and SOAP APIs.

Following these steps will help you gain hands-on experience in API Automation Testing using Tricentis Tosca.

This blog will cover everything from generating service access keys to scanning APIs, exploring JSON payloads, creating modules, and running automated tests in Tosca. It is designed for learners pursuing TOSCA Training, preparing for the TOSCA as1 Certification, or completing a TOSCA Certification Course.

By the end of this guide, you will understand the complete API automation workflow, practical JSON operations, module creation, and test execution in Tosca.

Overview of APIs

APIs, or Application Programming Interfaces, are a set of protocols and tools that allow software applications to communicate. APIs act as intermediaries between clients (like mobile apps or web browsers) and servers, handling requests and delivering responses.

For example, consider a coffee shop’s API that allows users to list, order, or delete coffee items. This API would have endpoints like:

  • GET /coffees – Retrieve a list of available coffees.
  • POST /coffees – Add a new coffee item.
  • PUT /coffees/{id} – Update coffee details.
  • DELETE /coffees/{id} – Remove a coffee item.

APIs are identified using a URI (Uniform Resource Identifier), which can be either a URL (Uniform Resource Locator) or a URN (Uniform Resource Name). The server hosting the API processes CRUD operations through HTTP methods: GET, POST, PUT, DELETE.

Postman is commonly used to test APIs manually, providing a visual interface to send requests and inspect responses.

Understanding these concepts is essential for effective API Automation Testing using Tricentis Tosca.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based format for representing structured data. It is widely used to exchange data between clients and servers. JSON is easy to parse, human-readable, and composed of key-value pairs and arrays.

Sample JSON

Simple JSON object:

{
"description": "H2kinfosys",
"name": "h2k"
}

JSON array example:

{
"description": "string",
"name": "string"
}

Nested JSON with metadata:

{
"links": {
"self": "http://example.com/articles"
},
"data": [
{
"type": "articles",
"id": "1",
"attributes": { "title": "JSON:API paints my bikeshed!" }
},
{
"type": "articles",
"id": "2",
"attributes": { "title": "Rails is Omakase" }
}
]
}

HTTP Status Codes

While testing APIs, you must monitor response codes to understand the result:

  • 200 – Request successful
  • 400 – Bad Request (client-side error)
  • 500 – Internal Server Error (server-side error)

Generating Service Access Key

To test certain APIs, an authentication key or service access key may be required. This key enables you to access protected API endpoints and perform operations. In API Automation Testing using Tricentis Tosca, you generate this key as the first step before scanning APIs or sending requests.

Using API Documentation

Swagger or OpenAPI documentation provides a detailed description of endpoints, methods, request parameters, and responses. Reviewing API documentation is essential to understand the data format, required fields, and response types. Before starting API Automation Testing using Tricentis Tosca, always explore the API documentation to plan your test scenarios.

Scanning APIs in Tosca

To automate APIs in Tosca:

  1. Launch Tosca Commander and create a workspace.
  2. Go to API Testing or right-click the module folder and select Scan → API.
  3. Click the URI option and enter the API definition URI.
  4. The API scanner will display all services, request and response messages.
  5. Provide request payloads, click run, and review the response payload.

Tosca supports scanning URIs for REST, SOAP, and JSON APIs. Once scanned, you can explore the API scanner’s request and response buttons to understand each API operation.

Exporting APIs to Tosca Commander

After verifying requests and responses:

  1. In Tosca Commander, select the workspace and right-click on the component folder.
API Automation Testing using Tricentis TOSCA
  1. Return to API Scanner, select required API services, and choose API Test Case → Export to Component Module.
API Automation Testing using Tricentis TOSCA
  1. A folder named APIScan_Import is created, containing Modules and Test Cases for each API service. Each API service has one request and one response module.
API Automation Testing using Tricentis TOSCA
  1. Test cases can then be executed from the API Component Module.

Running Test Cases from API Component Module

Once APIs are exported, you can execute test cases directly:

  • Send request payloads
  • Verify responses
  • Buffer values to reuse in subsequent API calls
  • Validate HTTP status codes

This ensures that API Automation Testing using Tricentis Tosca covers all CRUD operations effectively.

Creating Module Attributes

Modules in Tosca allow you to map request and response fields to test case attributes. Module attributes can be:

  • Dynamic List Items – Values captured during test execution
  • Static List Items – Fixed values predefined in the module
API Automation Testing using Tricentis TOSCA

The Attribute Assistant in Tosca helps configure attributes efficiently, supporting automated input and validation.

Auto Fill and Buffer Values

Tosca supports automatic filling of module attributes to simplify testing. Buffer values allow testers to capture response data and reuse it in subsequent requests, enabling data-driven testing. This is particularly important for validating JSON responses in dynamic APIs.

API Automation Testing using Tricentis TOSCA
API Automation Testing using Tricentis TOSCA

JSON Operations in Tosca

Tosca provides extensive support for JSON operations:

  • Parsing JSON objects and arrays
  • Accessing nested attributes
  • Validating JSON schemas

JSON Schema Validation Example

Response JSON:

{
“description”: “H2kinfosys”,
“name”: “h2k”
}

Schema:

{
"description": "string",
"name": "string"
}

Tosca validates the response against the schema to ensure all required fields are present and correctly typed.

Validating responses consistently is a key part of API Automation Testing using Tricentis Tosca.

Recording Messages

Tosca can capture API services from the UI, allowing testers to record requests and responses for automation. This feature is particularly useful for testing applications where API interactions are triggered by user actions.

Example Scenarios for API Automation Testing

REST API Example

Scan a JSON API definition, import messages, create modules, send requests, and validate responses using buffers and schema validation.

SOAP API Example

Scan SOAP services, generate modules for request and response, populate module attributes, and execute test cases to validate XML payloads.

Public API Example

Use public APIs to practice API Automation Testing using Tricentis Tosca, handling JSON arrays, nested objects, and dynamic lists.

Summary

  • APIs are crucial for modern applications.
  • JSON is the most common data format for REST APIs.
  • Tosca provides a codeless platform to automate API testing.
  • Core activities include scanning APIs, creating modules, configuring attributes, buffering values, and validating schemas.
  • Both REST (JSON) and SOAP (XML) services can be tested using Tosca.
  • Recording messages, auto-fill, and dynamic lists enhance automation efficiency.

By mastering API Automation Testing using Tricentis Tosca, testers can efficiently validate API behavior, reduce manual effort, and ensure high-quality software delivery.

Conclusion

API Automation Testing using Tricentis Tosca simplifies complex API testing workflows, supports multiple formats, and integrates seamlessly with test management. Begin by scanning APIs, generating modules, and executing test cases to gain hands-on experience. Mastering these steps is key for TOSCA Training, TOSCA as1 Certification, and TOSCA Certification Courses.

Share this article

Enroll Free demo class
Enroll IT Courses

Enroll Free demo class

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Join Free Demo Class

Let's have a chat