cancel
Showing results for 
Search instead for 
Did you mean: 

Automating Java Applications using SAP Build Process Automation.

Kiruthika
Associate
Associate
0 Kudos

Hello everyone, in this blog we are going to discuss about how we automate java applications using SAP Build Process Automation. 

SBPA supports automation of Java Swing and Java Fx framework applications. The Java Technology Automation capability is only available in SBPA tenants. The minimum version of Desktop Agent required to automate Java application is 3.18.43 and please refer the Java Help Portal for configuration of prerequisites. 

To start with we need to have SAP Build Process Automation Cloud Studio open in one browser window followed by keeping the Java application open and then follow the below mentioned steps: 

(Note: Java Automation SDK is supported only with e- agent running with Windows Operating system) 

Steps to Automate a sample Java Swing Application 

Step – 1:Create a new Task Automation in SBPA . Once the project is created, a new tab will be opened. (as shown in fig) 

Kiruthika_0-1707719016613.png

Step – 2:Click on Create to start with a new Application.

Kiruthika_1-1707719016618.png

All the applications running in our system will be listed down and we could see one more technology is listed under the search screens as Java Automation. 

On selecting Java Application, Only Capture Application would be available in Cloud Studio as Recorder is not supported currently. 

Click on Manual Capture to proceed ahead. 

 

Kiruthika_2-1707719016624.png

Step – 3: Once we click on Capture, the application will be captured with the technology Java Automation and framework as Java Swing as we have used swing application here. (shown in fig).  

Kiruthika_3-1707719016627.png

Step 4 : On the captured application you can declare the elements and select the appropriate criteria for it. For each declared element, the element class would be displayed as Java Swing or Java FX based on the type of captured java application. 

Kiruthika_4-1707719016631.png

Step 5 : Also we can add the screen based on the application workflow , here in this scenario we have 3 screens which has been captured via Add Screen (as shown in fig) 

Kiruthika_5-1707719016634.png

Step 6 : Once all the screens are captured under the Java Swing Application, we can move to creation of Automation. 

Kiruthika_6-1707719016638.png

Step 7 : Once we create the automation , to start a jar file with Start Application activity, we need to provide javaw.exe path into path input of activity. This javaw.exe should be part of the JDK which is required to run the application. In the parameter input field, we can pass class path and jar file as shown below as one string parameter 

Kiruthika_7-1707719016641.png

Step 8 : Add the Java Swing (Pizza Palace application i.e is captured) and drag the appropriate activities on the declared elements to automate the use case. Also add a Wait Screen activity in each screen so that bot will wait until the screen is present and then perform the designed actions.  

And the final bot looks like as shown below. 

Kiruthika_8-1707719016645.png

We have completed the designing of automation.  Now you can execute it and see if designed actions are performed at runtime.  

The above example is shown for the framework Java Swing , the same can be followed for the framework type Java FX applications.  

 Additional Points : 

  • The Java Automation also supports the capture on Hover option to capture the disappearing menu or list in Java applications.  
  • Use UI Automation or OCR techno for non Java screens in the Java application. Example - Windows Dialogue Boxes (Open, Save As etc). 

Do not forget to have a look at the Learning content in our SDK Document as it contains all the Java Swing/Java FX Activities. 

 

Accepted Solutions (0)

Answers (0)