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: 
aman91
Explorer
CBTA (Component Based Test Automation) is an integrated tool into SAP Solution Manager 7.2 for creating automated test scripts for various UIs.

For a lengthy period, SAP GUI (Graphical User Interface) and WebDynpros were the default interfaces for SAP-Applications. This changed after the introduction of SAPUI5 and FIORI – with the modern and flexible framework SAP created a completely new and appealing frontend for their applications.

Now the importance of testing FIORI applications has increased with that trend. CBTA also supports the frontend scripting of those FIORI Applications.

The overall supported UI technologies are the following:




































UI Technology Description
SAP GUI

UI Technology used by SAP Transactions

SAP GUI content displayed in MS Internet Explorer
Web / Plain HTML UI Technology used by non-SAP applications
WebCUIF UI Framework used mainly SAP CRM Web UIs.
SAP UI5 & FIORI UI Framework used by SAP UI5 and Fiori apps


Unified Rendering Light Speed

(LS)


UI Framework common to SAP Applications such as:

• Web Dynpro Application (ABAP)

• Web Dynpro Applications (Java)

• SAP GUI for HTML
BSP Applications based on Business Server Pages
Java Web Dynpro Layer formerly used by Java Web Dynpro applications.


In this blog I want to share how the process of scripting a FIORI Application looks like. I will show you how you can add a FIORI Executable manually to the Solution Documentation and start subsequently the scripting with CBTA.

Preparation: Add a FIORI Executable


 

In case the needed SAP FIORI Application is not in the execution library, you can easily add it manually to your solution. Therefore, navigate to the SAP Fiori apps reference library and search for the app by name, application or industry. In our case we’ll look for “Create Incident”.



 

It is important that you select the correct backend product. As a next step navigate to the “IMPLEMENTATION INFORMATION” tab and open the selection “Configuration”.



 

In the configuration section you will find some technical information about the application. For the executable we need the information listed in the section “Target Mapping(s)”.



 

Now we have the necessary information, to add the executable to the execution library. Navigate to the Solution Documentation --> “Execution Library”. Perform a right click in the Elements Area of the respective executable folder and select the option “New Executable Element”.



 

A pop-up window will appear, where we need to maintain the fields with the information from the Target Mapping(s):

  • Library Element Type: Fiori Application <Exec. Orig.>

  • Name: Process step name/App name and the App ID e.g. Create Incident (F2128)

  • Object: The Semantic Object e.g. Action

  • Action: The Semantic Action e.g. SMCreateIncident




 

The SAP FIORI Executable is now created in the execution library and can be used for scripting.


Create a Test Configuration


 

After adding the executable, we can now use it in an automated CBTA Script (Test configuration). For this, we need to navigate to the respective process step (in our case: “PS_Create_Incident”) and add the executable before creating a test configuration. Perform a right click in the elements area and choose “New” --> “Executable”. Search for the recently added executable and click on “OK”.





 

After adding the FIORI Executable in the correct Solution Documentation node, we are prepared for creating a test configuration. Therefore, perform a right click in the elements area again and choose “New” --> “Test Cases” --> “Test Configuration (Create)”. Fill out the necessary fields and click on “OK”.



 

Make sure that all the necessary fields like “Target System”, “Executable” and “Test Profile” are filled out. In case they are not, navigate to “Goto” --> “SUT Management” and check the sections “Technical Destination” and “Business Destination Enhancement Details”.





 

Since CBTA supports both the recording and execution with the Chrome-Browser, change the CBTA Settings according to the browser you are using before starting recording the script. Please see the following video about how to do the recording.

Recording Demo


 


Execution Demo




That's how easy it can be - so try it out yourself!
27 Comments
former_member63585
Participant
Hi Amanpreet, thanks for this. I appreciate the example which you used for a Fiori app to be tested.
Great blog. Thank you!
aman91
Explorer
0 Kudos
I am glad you liked it!
rim-sap-security
Explorer
0 Kudos
Do you have a guide on how to set-up roles for CBTA? Thanks in advance.
sabatale
Contributor
0 Kudos

Thanks for the info! Are there any specific guidelines when it comes to Cloud products, other than creating a custom Login Schema for SAP ID Service? (eg. C/4)

aman91
Explorer
0 Kudos
Hi Alexandre,

not that I know of - sorry.

Please keep in mind that CBTA only supports the UI mentioned in the following Note: https://launchpad.support.sap.com/#/notes/2436142

Thanks!
aman91
Explorer
0 Kudos
Hello Rimwell,

which roles exactly? The general user roles you can find here:

https://help.sap.com/viewer/0043dbb640674d9bb916602fe2ec90e8/7.2.06/en-US/70c743d5a9634a54aeb3a86084...

 

BR,

Aman
aman91
Explorer
0 Kudos
Thanks!
0 Kudos
Thanks for the example!
I tried it out, but found out that our Fiori apps behave quite slow and CBTA is automatically clicking faster than the application appears at the screen.
Do we have to add "wait commands" in the script or is there any better option to wait until the screen is completely available?

Thanks for a short answer
Norbert
0 Kudos
Asynchronous checkpoints are the solution.

Norbert
sady_2015
Participant
This is good info. I had created a few FIORI scripts 2 months back and those worked fine. But today when I tried to re-execute those, these failed due to the change in URI of the fields. From what I hear, every time there is a refresh the URIs change. Is there any solution to this issue? We need to run these scripts every month and if they keep failing due to change in URI so often, it becomes cumbersome to edit the URI using Object Spy. Have you come across this issue, if so, could you please share if there is a solution for this? we are using CBTA version 12 and have been done with SP8 upgrades a few months back. Thank you in advance for any info you can share.
jolapena
Explorer
Hi SAP community,

We are currently experiencing the same issue which also makes the maintenance very costly.

Could you please help us?

Thank you in advance,

Jose Angel
0 Kudos

Hi SAP community,

we were facing the same issue.

The solution for me was:
a) Setting the user parameter WD_STABLE_ID_F_TEST for the used business user
b) Using CBTA client 3.0.14.6

Norbert

bobbyp450
Explorer
0 Kudos
Thanks for sharing, its very helpful to set up FIORI.
Requesting to know if you have similar steps for WebDynpro applications.
0 Kudos
Hello Amanpreet,

Great blog!! Thank you for the example.

I have tried to do the same steps however, i am getting the error - App could not be opened either due to an incorrect SAP Fiori launchpad Configuration or missing role assignment.

Please let me know if you have any idea on how to solve this, please let me know

Thanks
aman91
Explorer
0 Kudos
Hi Danish,

thank you!

This is sometimes the case, when your test user (SolMan: Test Profile) does not have the necessary authorizations for the application you want to test.

 

Hope it helps!

 

Thank you and kind regards,

Aman
jyothi1998
Explorer
0 Kudos
Hi Aman, So don't we need to create login schema?
aman91
Explorer
0 Kudos
Hi Jyothirmai,

a login schema is still necessary for the system you want to test.

 

Hope it helps!

 

-Aman
AjayHS
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Jose,

Please re-execute the scripts after

  • Upgrading the CBTA frontend


Also check if you are on the latest SAPGUI

Thanks,

Aj
zemish
Explorer
0 Kudos

Hello all,

how can I configure Login Schema for Fiori App?

I created a Test Configuration with Fiori App Executable - see attachment, I selected Test Profile which I configurated in SUT properly.

https://i.ibb.co/yFPMQz2/log-in.png

When I click on Launch CBTA, system user (TST_S2P) does not log into S2P - see attachment - and CBTA Client displays "Unable to start the recording"

https://i.ibb.co/pXDTmmP/test-conf.png

I am not able to create LOGIN scheman for this type of executables. Why is not possible?

Log from CBTA taf:

2022-02-17 11:35:15,436 |    ERROR | MainThread          | LoginSchemaDefinition              | The given schema is none, no login request (anonymous).
2022-02-17 11:35:40,741 |    ERROR | MainThread          | PlayerHelper                       | OpenIsolatedBrowser - unexpected situation - processHandle is not set
2022-02-17 11:35:40,742 |    ERROR | MainThread          | PlayerHelper                       | OpenIsolatedBrowser - unexpected situation - browserApp is null
2022-02-17 11:35:40,742 |    ERROR | MainThread          | PlayerHelper                       | OpenIsolatedBrowser - first attempt returned null - Let's try again
2022-02-17 11:36:07,177 |    ERROR | MainThread          | PlayerHelper                       | OpenIsolatedBrowser - unexpected situation - processHandle is not set
2022-02-17 11:36:07,179 |    ERROR | MainThread          | PlayerHelper                       | OpenIsolatedBrowser - unexpected situation - browserApp is null
2022-02-17 11:36:07,222 |    ERROR | MainThread          | [WebLauncher]                      | WebLauncher - Unexpected Error: SAP.TAO.TestPlayer.Web.PlayerHelperException: OpenIsolatedBrowser - Failed to start the browser.
v SAP.TAO.TestPlayer.Web.PlayerHelper.OpenIsolatedBrowser(String url)
v SAP.TAO.TestRecorder.Recording.Web.WebLauncher.launchWebApplication(String url, String system, String client, String user, String pwd, String language, LoginSchemaDefinition lsd)
2022-02-17 11:36:07,225 |    ERROR | MainThread          | TestCreationWizardScenarioTO1      | Error occurred - TO1 PFA begin. Error is: System.Exception: Error while starting the recording
v CBTA.TestCreationWizard.TestCreationWizardScenarioTO1.Record()
2022-02-17 11:36:07,228 |    ERROR | MainThread          | TestCreationWizardRecordingStep    | Unable to start the recording!

Could you please advice me how to fix/solve it?

Thank you in advance!

Regards

David

aman91
Explorer
0 Kudos

Hi David,

 

thanks for reaching out! Can you go into the SUT Management and click on the "Check" button and see if it works?

 

I hope it helps.

 

With best,

Aman

zemish
Explorer
0 Kudos


 

See above. Everything is OK.

 

Regards

 

David
aman91
Explorer
0 Kudos
Hi David,

can you try to follow the instructions mentioned here (create login schema for web applications):

https://wiki.scn.sap.com/wiki/download/attachments/521863988/CBTA%203.0%20-%20Login%20Schema%20for%2...

 

With best,
Aman
sady_2015
Participant
0 Kudos
Hi Amanpreet,

Have a quick question....I was looking for the following date tokens for CBTA scripts...could you please help if possible?

  1. First day of the current month

  2. 15th day of the current month

  3. Last day of the current month


Thank you

sadhna
0 Kudos
Hi Amanpreet,

 

We have one issue, we have SolMan 7.2 with Test automation using CBTA. This is for S4 HANA and it has its separate Fiori front end server.

Now, Fiori transactions are defined in SolDoc with S4 logical component group associated with them.

But when we launch CBTA for those Fiori Transactions, it opens up S4 backend system and not opening Fiori front end page.

 

Thanks,

Piyush
TheresaP
Participant
0 Kudos
This may help; you need an additional LCG for the fiori front end server then map the 2 LCGs. The mapping between the two LCGs is established using a BAdI implementation of BAdI BADI_SMUDE_ADMIN_CENTRAL_SYST.

Please see https://wiki.scn.sap.com/wiki/display/SM/Working+with+Fiori+Frontend+Server

 
0 Kudos
Thanks Theresa for replying.

We already have 2 LCGs defined and also implemented this BADI.

But this BADI is for SolDoc, not for Test Suite.

We have issue with Test suite, if we create CBTA for Fiori Transaction, it is launching S4 backend system instead of front end.

The alternative is we use Fiori front end LCG as a SUT in CBTA, but in that case we have to map all the Fiori transactions defined in SolDoc to Fiori Front end LCG.

I am not sure what will be the future impact if we link SolDoc with ChaRM.

 

Thanks,

Piyush