JAVA Automation

1. Overview #

When using Clicknium’s JAVA automation, you can rely on the JAVA Access Bridge for recording and other UI element operations.

If you intend to record a JAVA application (such as an ERP JAVA client), Clicknium will utilize JAVA automation to record the element. However, you need to install the  JAVA extension  first.

Please note that the JAVA extension only supports JAVA 1.6 and versions below JAVA 14. For those using JAVA 9 and above, please follow the configuration steps for proper setup.

2. Locator attributes #

Before you can begin with Java automation, it is important to understand the concept of a locator . For Java automation, the attribute definition is provided in the following table:

NameequalscontainsstartWithendWithregex
NameYesYesYesYesYes
ClassNameYesYesYesYesYes
IsDirectChildYesNoNoNoNo
AccessKeyYesNoNoNoNo
IndexYesNoNoNoNo

3. Locator samples #

In order to demonstrate locator samples, we utilize a sample Java Swing application.

  • awt component
<Application processName="javaw" filePath="javaw.exe" version="1.3" />
<Java className="frame" isDirectChild="True" name="SwingSet2" />
<Java className="root pane" isDirectChild="True" />
<Java className="layered pane" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="page tab list" isDirectChild="True" />
<Java className="page tab" isDirectChild="True" name="Internal Frames Demo" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="desktop pane" isDirectChild="True" />
<Java className="internal frame" isDirectChild="True" name="Frame 4 " />
<Java className="AWT component" isDirectChild="True" />
  • menu Themes
<Application processName="javaw" filePath="javaw.exe" version="1.3" />
<Java className="frame" isDirectChild="True" name="SwingSet2" />
<Java className="root pane" isDirectChild="True" />
<Java className="layered pane" isDirectChild="True" />
<Java className="menu bar" isDirectChild="True" name="Swing demo menu bar" />
<Java className="menu" isDirectChild="True" name="Themes" />
  • toggle button
<Application processName="javaw" filePath="javaw.exe" version="1.3" />
<Java className="frame" isDirectChild="True" name="SwingSet2" />
<Java className="root pane" isDirectChild="True" />
<Java className="layered pane" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="tool bar" isDirectChild="True" />
<Java className="toggle button" index="3" isDirectChild="True" />
  • text input
<Application processName="javaw" filePath="javaw.exe" version="1.3" />
<Java className="frame" isDirectChild="True" name="SwingSet2" />
<Java className="root pane" isDirectChild="True" />
<Java className="layered pane" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="page tab list" isDirectChild="True" />
<Java className="page tab" isDirectChild="True" name="Internal Frames Demo" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="desktop pane" isDirectChild="True" />
<Java className="internal frame" isDirectChild="True" name="Internal Frame Generator" />
<Java className="root pane" isDirectChild="True" />
<Java className="layered pane" isDirectChild="True" />
<Java className="panel" isDirectChild="True" />
<Java className="panel" index="3" isDirectChild="True" />
<Java className="text" isDirectChild="True" />

4. JAVA element properties #

By using the  find_element method on a Java locator, you can retrieve a Java element and access its properties with the get_property method. Clicknium Java supports the following properties:

NameDescription
Namename of the user interface
BoundingRectanglethe coordinates of the rectangle that completely encloses the element
Statesstates of elements such as enabled, visible, showing, focusable
IndexInParentthe index of current UI element in parent element
IsKeyboardFocusablewhether the UI element can accept keyboard focus
IsEditablewhether the UI element is editable or not
IsOffscreenwhether the UI element is visible on the screen(true when the control is not visible; otherwise false)
ProcessIdthe process identifier (ID) of this element
What are your feelings
Updated on 1 December 2023