API testing plays a crucial role in software development, and with Tricentis Test Automation for SAP (TTA) SAP Enterprise Continuous Testing by Tricentis (ECT), developers can ensure that their APIs are reliable, scalable, and meet industry standards.

This article will focus exclusively on the topic of API Testing. Furthermore, a forthcoming blog post will cover the topic of Orchestrated Service Virtualization (OSV) which allows developers to create virtual services that simulate real-world APIs for testing purposes.

HOW TO TEST AN API WITH TTA or ECT?

Disclaimer: The demo API used in this tutorial was developed solely for demonstration purposes and does not return any values of legal significance. LINK

Step 1: Verify the Swagger documentation of your API (if available)

  • Open the Swagger (or equivalent) documentation for the API you want to test.
  • Review the available endpoints, request and response payloads, and any other relevant information about the API’s behavior and functionality.
  • Use this information to plan your API testing strategy and create your API test cases.

Link to the Swagger of a SAP demo API

Step 2: Create an API test project in Tricentis Tosca

  • Open Tricentis Tosca and create a new API test project (button “API Scan”).
  • Enter the API endpoint URL, headers, and authentication details. Define the input parameters and expected output parameters for the API.

Step 3: Record API test scenarios

  • Record your API test scenarios by sending requests to the API endpoint and capturing the responses (button “Run”).
  • Use Tricentis Tosca’s recording feature to create test cases automatically based on your interactions with the API (button “API Test Case”).

Step 4: Enhance and parameterize API test cases

When creating an API test project, two Modules are created by default: the “Request module” and the “Response module”. Additionally, two Test cases are created: the “Request Test Case” and the “Response Test Case”.

To create modules attributes in Tosca, you can use the “Add” button in the module’s Attribute tab. This allows you to define the attributes for the module, such as input parameters, headers, and expected output parameters.

Here are the steps to create a new attribute in a module:

  1. Open the module that you want to add an attribute to.
  2. Select your attributes directly in the “Technical view” tab.
  3. Navigate to the Attribute tab and click on the “Add” button to create a new attribute.
  4. Enter a name for the attribute and select its data type.
  5. Specify any other relevant properties for the attribute, such as whether it is a required field or a default value.
  6. Save the attribute and repeat the process for any additional attributes that need to be added.

By defining the attributes for the Request and Response modules, you can create a detailed specification for the API messages that will be sent and received during testing. This helps ensure that your API tests are comprehensive and cover all relevant scenarios.

Step 5: Execute API tests

Execute your API tests and view the results in Tricentis Tosca’s test execution section or directly via the Scratchbook.

WHAT’S NEXT: Orchestrated Service Virtualization (OSV)

To conclude, API testing is an essential part of software development. Tricentis Test Automation for SAP (TTA) and SAP Enterprise Continuous Testing by Tricentis (ECT) provide robust solutions for testing APIs. By following the steps outlined in this article, users can create comprehensive API test cases and execute them efficiently.

In the upcoming blog post, we will discuss the topic of Orchestrated Service Virtualization (OSV), which enables users to create virtual services that mimic real-world APIs for testing purposes.

Follow my profile to be notified of the next blog post. Please feel free to ask any questions in the comments section below.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x