Java Automation using JAB (Java Access Bridge)
Product uses Java Instrumentation approach to automate the java applications which are built in JRE 1.5+. For the applications which are built in lower versions, we have JAB approach which is in combination with Micro-bots. JAB is a license software and in order to use this customization, you need to procure the license.
NOTE: |
This is the micro bot implementation. |
Overview
Java Access Bridge is a technology that exposes the Java Accessibility API in a Microsoft Windows DLL, enabling Java applications and applets that implement the Java Accessibility API to be visible to assistive technologies on Microsoft Windows systems.
- Java Accessibility API is a part of Java Accessibility Utilities, which is a set of utility classes that help assistive technologies provide access to GUI toolkits that implement the Java Accessibility API.
- Java Access Bridge is the package provided by Oracle, following is the URL for same:
https://www.oracle.com/technetwork/java/javase/tech/jab-previous-releases-354403.html
NOTE: |
This may take substantial amount of time depending on the process followed by clients to procure a software. |
- Downloaded package contains following libraries:
- Windows DLL: WindowsAccessBridge.dll
- Runtime DLLs: JavaAccessBridge.dll and JAWTAccessBridge.dll
- Java Access Bridge JAR: access-bride.jar and jaccess-1_4.jar
- JAAPI: Java Accessibility API
- Java Accessibility Utilities: Set of utility classes that help assistive technologies provide access to GUI toolkits that implement the Java Accessibility API.
- Native Assistive Technology: JavaFerret and JavaMonkey
- For enabling Java Access Bridge, follow the instructions given in the following link:
https://docs.oracle.com/javase/accessbridge/2.0.2/setup.htm
Launch the application to be automated and with the help of assistive technology tools that is JavaFerret and JavaMonkey, fetch the details for controls to be automated, as seen below in the image.
Micro-bot implementation for JAB
Below diagram shows the overall flow for the automation using JAB Micro-bots.
- JAB Micro-bot will call JAB API which interacts with Java Application.
- Upon loading the required environment i.e. Robot, AEAttendedRPA method “JavaAccessBridge.Windows_run()” needs to be called so that it will get information about all the opened windows. This can be achieved using AEAttendedRPACustomControlsProjects from AddOns folder available as part of build.
- Micro-bot contains the customized dll which takes the handle of running java application.
- Once handle is fetched, details are passed to JAB API to perform interactions on application.
- Following snap shot shows how the parameters need to be passed to the provided micro-bot. These parameters are fetched as per the Snip 1.
- First two parameters from Bounding Rectangle are values for xInput and yInput fields.
- Using spy++, you can get the values for className and windowName fields for the launched Java application.
- Similarly, you can create your own micro-bots to perform the interactions.