{"id":31762,"date":"2025-11-05T07:46:58","date_gmt":"2025-11-05T12:46:58","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=31762"},"modified":"2025-11-05T07:47:00","modified_gmt":"2025-11-05T12:47:00","slug":"api-automation-testing-using-tricentis-tosca-overview-of-apis-and-json-methods","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/api-automation-testing-using-tricentis-tosca-overview-of-apis-and-json-methods\/","title":{"rendered":"API Automation Testing using Tricentis TOSCA: Overview of APIs and JSON Methods"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Following these steps will help you gain hands-on experience in API Automation Testing using Tricentis Tosca.<\/p>\n\n\n\n<p>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 <a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\">TOSCA Training<\/a>, preparing for the TOSCA as1 Certification, or completing a TOSCA Certification Course.<\/p>\n\n\n\n<p>By the end of this guide, you will understand the complete API automation workflow, practical JSON operations, module creation, and test execution in Tosca.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Overview of APIs<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>For example, consider a coffee shop\u2019s API that allows users to list, order, or delete coffee items. This API would have endpoints like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GET \/coffees \u2013 Retrieve a list of available coffees.<br><\/li>\n\n\n\n<li>POST \/coffees \u2013 Add a new coffee item.<br><\/li>\n\n\n\n<li>PUT \/coffees\/{id} \u2013 Update coffee details.<br><\/li>\n\n\n\n<li>DELETE \/coffees\/{id} \u2013 Remove a coffee item.<br><\/li>\n<\/ul>\n\n\n\n<p>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 <a href=\"https:\/\/en.wikipedia.org\/wiki\/API\" rel=\"nofollow noopener\" target=\"_blank\">API<\/a> processes CRUD operations through HTTP methods: GET, POST, PUT, DELETE.<\/p>\n\n\n\n<p>Postman is commonly used to test APIs manually, providing a visual interface to send requests and inspect responses.<\/p>\n\n\n\n<p>Understanding these concepts is essential for effective API Automation Testing using Tricentis Tosca.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is JSON?<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Sample JSON<\/strong><\/h3>\n\n\n\n<p>Simple JSON object:<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"description\": \"H2kinfosys\",<br>  \"name\": \"h2k\"<br>}<br><\/pre>\n\n\n\n<p>JSON array example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"description\": \"string\",<br>  \"name\": \"string\"<br>}<br><\/pre>\n\n\n\n<p>Nested JSON with metadata:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>\"links\": {<br>\"self\": \"http:\/\/example.com\/articles\"<br>},<br>\"data\": [<br>{<br>\"type\": \"articles\",<br>\"id\": \"1\",<br>\"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }<br>},<br>{<br>\"type\": \"articles\",<br>\"id\": \"2\",<br>\"attributes\": { \"title\": \"Rails is Omakase\" }<br>}<br>]<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>HTTP Status Codes<\/strong><\/h3>\n\n\n\n<p>While testing APIs, you must monitor response codes to understand the result:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>200<\/strong> \u2013 Request successful<br><\/li>\n\n\n\n<li><strong>400<\/strong> \u2013 Bad Request (client-side error)<br><\/li>\n\n\n\n<li><strong>500<\/strong> \u2013 Internal Server Error (server-side error)<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Generating Service Access Key<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Using API Documentation<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Scanning APIs in Tosca<\/strong><\/h2>\n\n\n\n<p>To automate APIs in Tosca:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Launch Tosca Commander and create a workspace.<br><\/li>\n\n\n\n<li>Go to API Testing or right-click the module folder and select Scan \u2192 API.<br><\/li>\n\n\n\n<li>Click the URI option and enter the API definition URI.<br><\/li>\n\n\n\n<li>The API scanner will display all services, request and response messages.<br><\/li>\n\n\n\n<li>Provide request payloads, click run, and review the response payload.<br><\/li>\n<\/ol>\n\n\n\n<p>Tosca supports scanning URIs for REST, SOAP, and JSON APIs. Once scanned, you can explore the API scanner&#8217;s request and response buttons to understand each API operation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Exporting APIs to Tosca Commander<\/strong><\/h2>\n\n\n\n<p>After verifying requests and responses:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In Tosca Commander, select the workspace and right-click on the component folder.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-10-1024x576.png\" alt=\"API Automation Testing using Tricentis TOSCA\" class=\"wp-image-31767\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-10-1024x576.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-10-300x169.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-10-768x432.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-10-1536x864.png 1536w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-10.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Return to API Scanner, select required API services, and choose API Test Case \u2192 Export to Component Module.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\"><img decoding=\"async\" width=\"1024\" height=\"644\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-9-1024x644.png\" alt=\"API Automation Testing using Tricentis TOSCA\" class=\"wp-image-31766\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-9-1024x644.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-9-300x189.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-9-768x483.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-9.png 1430w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>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.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\"><img decoding=\"async\" width=\"1024\" height=\"594\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-7-1024x594.png\" alt=\"API Automation Testing using Tricentis TOSCA\" class=\"wp-image-31764\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-7-1024x594.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-7-300x174.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-7-768x445.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-7.png 1521w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Test cases can then be executed from the API Component Module.<br><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Running Test Cases from API Component Module<\/strong><\/h2>\n\n\n\n<p>Once APIs are exported, you can execute test cases directly:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Send request payloads<br><\/li>\n\n\n\n<li>Verify responses<br><\/li>\n\n\n\n<li>Buffer values to reuse in subsequent API calls<br><\/li>\n\n\n\n<li>Validate HTTP status codes<br><\/li>\n<\/ul>\n\n\n\n<p>This ensures that API Automation Testing using Tricentis Tosca covers all CRUD operations effectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating Module Attributes<\/strong><\/h2>\n\n\n\n<p>Modules in Tosca allow you to map request and response fields to test case attributes. Module attributes can be:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Dynamic List Items<\/strong> \u2013 Values captured during test execution<br><\/li>\n\n\n\n<li><strong>Static List Items<\/strong> \u2013 Fixed values predefined in the module<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-11-1024x576.png\" alt=\"API Automation Testing using Tricentis TOSCA\" class=\"wp-image-31768\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-11-1024x576.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-11-300x169.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-11-768x432.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-11-1536x864.png 1536w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-11.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>The Attribute Assistant in Tosca helps configure attributes efficiently, supporting automated input and validation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Auto Fill and Buffer Values<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"523\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-6-1024x523.png\" alt=\"API Automation Testing using Tricentis TOSCA\" class=\"wp-image-31763\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-6-1024x523.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-6-300x153.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-6-768x392.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-6.png 1405w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"515\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-8-1024x515.png\" alt=\"API Automation Testing using Tricentis TOSCA\" class=\"wp-image-31765\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-8-1024x515.png 1024w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-8-300x151.png 300w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-8-768x386.png 768w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2025\/11\/image-8.png 1428w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>JSON Operations in Tosca<\/strong><\/h2>\n\n\n\n<p>Tosca provides extensive support for JSON operations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Parsing JSON objects and arrays<br><\/li>\n\n\n\n<li>Accessing nested attributes<br><\/li>\n\n\n\n<li>Validating JSON schemas<br><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>JSON Schema Validation Example<\/strong><\/h3>\n\n\n\n<p>Response JSON:<\/p>\n\n\n\n<p>{<br>&#8220;description&#8221;: &#8220;H2kinfosys&#8221;,<br>&#8220;name&#8221;: &#8220;h2k&#8221;<br>}<\/p>\n\n\n\n<p>Schema:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>\"description\": \"string\",<br>\"name\": \"string\"<br>}<\/pre>\n\n\n\n<p>Tosca validates the response against the schema to ensure all required fields are present and correctly typed.<\/p>\n\n\n\n<p>Validating responses consistently is a key part of API Automation Testing using Tricentis Tosca.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Recording Messages<\/strong><\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example Scenarios for API Automation Testing<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>REST API Example<\/strong><\/h3>\n\n\n\n<p>Scan a JSON API definition, import messages, create modules, send requests, and validate responses using buffers and schema validation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>SOAP API Example<\/strong><\/h3>\n\n\n\n<p>Scan SOAP services, generate modules for request and response, populate module attributes, and execute test cases to validate XML payloads.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Public API Example<\/strong><\/h3>\n\n\n\n<p>Use public APIs to practice API Automation Testing using Tricentis Tosca, handling JSON arrays, nested objects, and dynamic lists.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>APIs are crucial for modern applications.<br><\/li>\n\n\n\n<li>JSON is the most common data format for REST APIs.<br><\/li>\n\n\n\n<li>Tosca provides a codeless platform to automate API testing.<br><\/li>\n\n\n\n<li>Core activities include scanning APIs, creating modules, configuring attributes, buffering values, and validating schemas.<br><\/li>\n\n\n\n<li>Both REST (JSON) and SOAP (XML) services can be tested using Tosca.<br><\/li>\n\n\n\n<li>Recording messages, auto-fill, and dynamic lists enhance automation efficiency.<br><\/li>\n<\/ul>\n\n\n\n<p>By mastering API Automation Testing using Tricentis Tosca, testers can efficiently validate API behavior, reduce manual effort, and ensure high-quality software delivery.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>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, <a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\">TOSCA as1 Certification<\/a>, and <a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\">TOSCA Certification Course<\/a>s.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":31771,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1994],"tags":[200,2249,2002,2003],"class_list":["post-31762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tosca-automation","tag-api-testing","tag-json-api-testing","tag-tosca-automation","tag-tosca-certification"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/31762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=31762"}],"version-history":[{"count":1,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/31762\/revisions"}],"predecessor-version":[{"id":31772,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/31762\/revisions\/31772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/31771"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=31762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=31762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=31762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}