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:
Name | equals | contains | startWith | endWith | regex |
---|---|---|---|---|---|
Name | Yes | Yes | Yes | Yes | Yes |
ClassName | Yes | Yes | Yes | Yes | Yes |
IsDirectChild | Yes | No | No | No | No |
AccessKey | Yes | No | No | No | No |
Index | Yes | No | No | No | No |
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:
Name | Description |
---|---|
Name | name of the user interface |
BoundingRectangle | the coordinates of the rectangle that completely encloses the element |
States | states of elements such as enabled, visible, showing, focusable |
IndexInParent | the index of current UI element in parent element |
IsKeyboardFocusable | whether the UI element can accept keyboard focus |
IsEditable | whether the UI element is editable or not |
IsOffscreen | whether the UI element is visible on the screen(true when the control is not visible; otherwise false) |
ProcessId | the process identifier (ID) of this element |