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: 
jasmeetsingh
Associate
Associate
Concept and Need:  

While making modifications in an Action definition, it is often useful to validate the changes before releasing the Project so that user can make necessary modifications based on execution response.
 

Parent Blog: 

 Actions Editor – Feature List, Usage and Maintenance of Actions Project 

This can be achieved using the Test Tab.
Test tab provides capability to capture necessary configuration and test data.

Test Tab



 


Figure 1: Test Tab


There are two sections in the Test tab. 

  • Connectivity 


The Connectivity section can be used to provide connectivity configuration that is needed to execute an Action. 


Figure 2: Connectivity panel


Note: These settings are persisted across Actions.
 

An Action can be tested either by selecting a Destination or by providing Manual configuration. 

  • Using Destination 


Action can be executed using destinations created in the subscriber's subaccount.

Destination can be selected using the Select Destination dropdown in the connectivity panel.  

Note: There can be many Destinations created in the cockpit and not all Destinations are relevant for an Action Project. Due to this very reason, user needs to explicitly allow destinations to be used by Actions framework. 

To do so Go to destination and add additional property
sap.applicationdevelopment.actions.enabled = true



Figure 3: Adding additional properties to a destination


These Destinations will be displayed in the editor for selection and can be consumed by the Actions framework.  

  • Using Manual Configuration 


Alternatively, the user can also use manual configuration to test an Action. 

This helps in testing an Action quickly by eliminating the need of destination creation. 

‘No Authentication’ and ‘Basic Authentication’ is currently supported in Manual configuration.


Figure 4: Manual Configuration panel


Providing Test Input 

 Test inputs can be provided in the form present below Connectivity section. 

Properties that user has added in the input parameter table and input body table are displayed along with the default values.   


Figure 5: Input form to enter test data


After entering test data an Action can be executed using ‘Test’ button .

Note: Input provided by the user is validated against the input schema definition before the Action is executed.   

Viewing Action execution response 

After action execution is successful. The output will be displayed in Response Preview.

User might see a difference between the actual API response and Action response because the API response is filtered on the basis of output schema definition. If a property is present in API response but it is not part of output schema, it will be filtered out.

 


Figure 6: Response Preview
 


Response preview is accessible from Input/Output/ Test tabs to make modifications easier. 

Note: Maximum response size of 1MB is supported for an Action. An error dialog will be displayed if response size exceeds permissible limits. 

 

Thanks for reading and I hope it helped to understand how an Action can be tested using Actions Editor. Please feel free to leave a comment if there are any questions and I would be happy to receive any feedback.

 

References



 
3 Comments