Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
valentinb
Advisor
Advisor

BACKGROUND


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.
8 Comments
BasanthSwain
Participant
0 Kudos
Hi Valentin,

How are you?

I have a quick question on TTA, Does TTA offer any Reporting functionality?

 

Thanks

Basanth
valentinb
Advisor
Advisor
0 Kudos
Hi Basanth,

There is no reporting functionality directly in TTA. The only thing you can find is the results of your tests/group of tests and the detailed logs in the "Execution" section.

If you want to generate reports, the only option is to take advantage of the integration with SAP Solution Manager. This will generate reports on automated tests run with TTA.

The SAP Enterprise Continuous Testing (ECT) version, on the other hand, enables reporting directly within the application, as well as via the SAP Solution Manager integration.

Best regards,

Valentin
former_member556094
Discoverer
0 Kudos

Hi Experts, 

After TTA Server16.0 been installed, I opened Admin console through broweser using " localhost ". However in Landing page when I click User administration its not asking Admin login & password. Rather its asking to register an User,however I did it but created user is not having admin rights. Pls suggest how can I login to TTA Server16.0 as Admin user. In earlier version TTA Server 14.2 it used to show Admin login screen where credentials were admin/admin but in TTA server16.0 Iam not getting admin login screen. Pls help here , how can I login to TTA Server as Admin.

Thanking you in advance!

Regards

G.Das

valentinb
Advisor
Advisor
0 Kudos
Hi Gyanendra,

You can try logging in using the "User Administration" tile first. The credentials should be set to Admin/Admin by default (with a capital "A"). I also recommend that you restart the Tosca Server services if this doesn't work.
former_member556094
Discoverer
0 Kudos

Hi Valentin,

Thank you for your reply!

I checked all 6 Tricentis servcies running successfully. please find same in the atted image.

When I clicked  "User Administration" tile  it shows error like "A server error has occurred!"

Please suggest how to resolve this issue.

valentinb
Advisor
Advisor
0 Kudos

Hi Gyanendra,

To help you solve this problem, I'd advise you to open an incident, mentioning the component XX-PART-TRI-TTA to speed up the process.

Best Regards,

BasanthSwain
Participant
0 Kudos
Hi Valentin

I have a query on TTA (Client and Server installation)

We have the SAP GUI and the TTA client or TOSCA Client in a machine which the testers access via VDI.

The TOSCA server is installed on a MS SQL server.

During setting up a workspace, we provide the Server, Database, UID and password in the connection string and it says the connection is valid however we get a message while creating a new Workspace

'The selected Common Repository is not empty. Use another Database, another schema or delete existing tables' Can you help in commenting if the setup is correct.

 

Many Thanks

Basanth

 

 
valentinb
Advisor
Advisor
0 Kudos
Dear Basanth,
Thanks for your message. It seems that you already have something in the MS SQL database.


In this case there are 2 possibilities:


  1. you forgot to tick "use existing Repository" when you created your workspace

  2. the MS SQL database was initially misconfigured or corrupted. I advise you to check that all the prerequisites have been applied: https://documentation.tricentis.com/sap/tta/1600/en/content/installation_tosca/prepare_mssql.htm



If nothing works, I suggest you open an incident with SAP support.


Best regards,

Valentin.