Automating REST & SOAP APIs in Tosca

 Automating REST and SOAP APIs in Tricentis Tosca involves using Tosca's API testing module, which supports both API types out of the box. Below is a step-by-step guide to help you automate REST and SOAP APIs in Tosca.


πŸ”§ General Setup

Before starting:


Ensure the Tosca API Scan module is installed.


Have access to the API specifications (WSDL for SOAP or Swagger/OpenAPI/URL for REST).


πŸ§ͺ Automating REST API in Tosca

Step 1: Use API Scan Tool

Open Tosca Commander.


Go to Modules → API Testing → Launch API Scan.


Enter the REST endpoint URL (e.g., https://api.example.com/v1/users).


Select the HTTP method (GET, POST, PUT, DELETE, etc.).


Add headers, query parameters, and body as needed.


Click Send to test.


Step 2: Generate Tosca Module

Once the request is working in API Scan, click “Save as Module”.


This creates a Tosca Module that can be reused in TestCases.


Step 3: Create Test Case

Right-click on the newly created module → Create TestCase.


Fill in required inputs like parameters or JSON body values in the TestStep.


Add verifications (e.g., check status code 200, specific JSON values, etc.).


🌐 Automating SOAP API in Tosca

Step 1: Import WSDL

Open Tosca → API Scan.


Choose “Import from URL or File”, then select or enter the WSDL location.


Tosca will parse the WSDL and display all available services/operations.


Step 2: Send Request

Select the desired SOAP operation.


Fill in the required SOAP envelope details.


Click Send to test the request.


Step 3: Save as Module

Just like REST, save the request as a Tosca Module.


Step 4: Create Test Case

Create a TestCase from the SOAP module.


Modify the input parameters in the TestStepValues.


Add verifications to the response (e.g., check XML tags/values).


✅ Verification and Assertions

Tosca allows you to drag response fields (JSON or XML) into the Verification section.


You can verify:


HTTP Status code


Response values (e.g., name = John)


JSON/XML structure


πŸ”„ Dynamic Data & Chaining

You can chain API calls using buffering:


Example: Save userID from the response of one API and use it in the next.


Use ={BufferName} syntax to refer to stored values.


🧩 Best Practices

Use TestSheet and TestCaseDesign for data-driven API tests.


Parameterize headers (e.g., Auth token).


Reuse common modules for maintainability.


Enable logging in API Scan for easier debugging.

Learn Tosca Training in Hyderabad

Read More

Connecting Tosca with SQL Databases

Tosca and qTest: Better Together

Tosca Integration with Azure DevOps Pipelines

How Tosca Integrates with Test Management Tools

Visit Our IHUB Talent Training Institute in Hyderabad

Get Directions

Comments

Popular posts from this blog

How to Install and Set Up Selenium in Python (Step-by-Step)

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

Waits in Playwright: Explicit, Implicit, and Auto