The API Testing menu consists of four sections:
Module Attribute
Connection
Tools
Message
Module Attribute
Module Attributes are business-relevant elements of a message, such as a name, ID, or address. Module Attributes allow you to steer the values of these message elements in your TestCase. You can define Module Attributes for the following elements of a message in Tosca Commander:
Attachments
Authentication
Headers
Method, endpoint, and resource
Parameters
Payload
Status code and response time
Add Module Attributes with Dynamic List Item(s)
Add Module Attributes with Static List Item(s)
Open the Attribute Assistant to add Module Attributes
Add and buffer Module Attributes. The dropdown menu offers the following options:
Buffer Module Attributes with Dynamic List Item(s)
Buffer Module Attributes with Static List Item(s)
Open the Attribute Assistant to add and buffer Module Attributes
We can create Body Module Attributes from the elements of a message or the whole body of a message. Use the dynamic menu API Testing to create body Module Attributes from the body of your request message or your response message.
Create body Module Attributes from a request message:
To add or buffer the body of your request message, follow the steps below:
Select the Module and switch to the Technical View.
Access the API Testing menu.
Click Body and select one of the following options from the dropdown menu:
To mark the entire payload and add it as a Module Attribute, click Insert Message.
To mark the entire payload and buffer it as a Module Attribute, click Insert from Buffer.
To load a payload from file as a Module Attribute, click Load from File ....
In the subsequent dialog, select a file name and click Open.
To add or buffer the body of your response message, follow the steps below:
Select the Module and switch to the Technical View.
Access the API Testing menu.
Click Body and select one of the following options from the dropdown menu:
To mark the entire payload and add it as a Module Attribute, click Verify Message.
To mark the entire payload and buffer it as a Module Attribute, click Buffer Message.
To save the payload of your message as a Module Attribute, click Save to File ....
In the subsequent dialog, define a file name and click Save.
Check whether the Module Attributes in your API Modules are valid. This can be useful, for instance, if you performed any updates or changes to a Module.
To validate Module Attributes, follow the steps below:
In Tosca Commander, select one of the following elements:
a Module Attribute
an API Module
a Module folder that contains API Modules
a ComponentFolder that contains API Modules and TestCases
the project root element
Navigate to the API Testing menu.
In the Module Attribute section, click Validate.
You can use the Update function to update your Module Attributes in one of the following cases:
Your payload has changed.
You want to use an existing Module Attribute to steer a different element within the payload.
Tricentis Tosca automatically applies any changes you perform on the Module to the corresponding messages.
To update a Module Attribute, follow the steps below:
Select the respective Module Attribute.
The Technical View displays the current element to be steered in your TestCase.
The XPath expression in the Properties pane displays the link to the element in the payload.
In the Payload tab, highlight the new or changed element with your mouse.
Click Update in the API Testing menu.
The system displays the updated XPath expression in the Properties pane.
If you update a body Module Attribute, the system updates the DefaultValue.
Connection
Use the Connection section of the API Testing menu to open the API Connection Manager and to add connections.
You can use the API Connection Manager to manage all your API connections and environments in one place.
The following options are available in the Connection section:
Manage - Open the API Connection Manager.
Create - Create a connection from an API Module to the API Connection Manager.
Tools
Use the Tools section of the API Testing menu to open Tricentis Tosca API Scan, open selected Modules in API Scan and to convert OSV scenarios into API TestCases.
The following options are available in the Tools section:
API Scan - Start API Scan or open selected Modules in API Scan.
Convert to TestCase - Convert an OSV Scenario into an API TestCase.
Message
Use the Message section of the API Testing menu to search message payloads, add files to your message, generate XTestStepValues, and to format the visible message. Additionally, you can update API Modules if the schema has changed.
The following options are available in the Message section:
Update - Update API Modules.