Tosca for API Testing: A Step-by-Step Tutorial

 ๐Ÿ” Tosca for API Testing: A Step-by-Step Tutorial

Tosca by Tricentis is a popular automation tool used for testing APIs, web, mobile, and more — all without writing code. It provides a low-code/no-code interface and supports SOAP and REST APIs.


๐Ÿงฑ Before You Begin

✅ Prerequisites:

Tosca Commander installed


Basic understanding of API (REST or SOAP)


A sample API to test (e.g., https://reqres.in/api/users)


๐Ÿš€ Step-by-Step Guide

✅ Step 1: Create a New Tosca Workspace

Open Tosca Commander


Create a new workspace or open an existing one


Select a Project Root (like API_Testing_Tutorial)


✅ Step 2: Scan the API

Go to the API Scan tool (you can launch it from Tosca or standalone)


Click + Add API Connection


Choose REST or SOAP


Enter the base URL (e.g., https://reqres.in)


Browse available endpoints and select one to scan


Click Scan to import the API definition


Save and return to Tosca Commander


✅ Step 3: Create an API Test Case

In Tosca Commander, right-click on a Module folder

→ Select Create TestCase


Drag the scanned API module (like GET /api/users) into the TestCase


A test step will be created with request parameters and headers


✅ Step 4: Configure the API Request

In the test step, fill in the required values:


For GET requests: Add query parameters (like page=2)


For POST requests: Add JSON body under Request Payload


Set necessary headers like Content-Type: application/json


✅ Step 5: Add Validations (Verifications)

To validate the response:


Go to the Response section


Right-click on the response fields (like status, name, id)

→ Select Verify


Enter expected values (e.g., status = 200 or first_name = Janet)


✅ Step 6: Run the API Test Case

Right-click on the TestCase

→ Select Run


Tosca will execute the API call and show Pass/Fail status


View the Test Results for response time, actual data, and any errors


๐Ÿงช Example: Test a GET API Endpoint

Endpoint: GET https://reqres.in/api/users?page=2

Steps in Tosca:


Method: GET


Query Param: page = 2


Expected status: 200


Expected response field: data[0].first_name = Michael


✅ Run the test and validate that the data matches.


๐Ÿงฐ Bonus Features in Tosca API Testing

Feature What It Does

Chained Requests Use output of one API as input to another

Test Data Service Store reusable test data

Authentication Supports OAuth, Basic Auth, Bearer Tokens

Environment Management Easily switch between staging, QA, and prod URLs


๐Ÿ“Œ Best Practices

Use Templates for repeatable test steps


Organize tests by API type or module


Use Data-Driven Testing to test multiple inputs


Group tests into Test Case folders for clarity


✅ Summary

Step Action

1️⃣ Scan the API using Tosca API Scan

2️⃣ Create a TestCase

3️⃣ Add and configure API request

4️⃣ Add verifications

5️⃣ Run and validate results

Learn Tosca Training in Hyderabad

Read More

Automating Web Applications with Tosca

Test Automation in Tosca

Tosca Test Data Management Basics

Tosca ScratchBook vs ExecutionList: What’s the Difference?

Visit Our Quality Thought Training in Hyderabad

Get Directions

Comments

Popular posts from this blog

Understanding Snowflake Editions: Standard, Enterprise, Business Critical

Why Data Science Course?

How To Do Medical Coding Course?