RPA.JavaAccessBridge
Refresh application element tree
Might be required action after application element structure changes after window refresh.
Call element action
Arguments
Argument | Type | Default value |
---|---|---|
locator | str | null |
action | str | null |
param locator: | target element |
---|---|
param action: | name of the element action to call |
Keyword to mouse click at specific coordinates.
Arguments
Argument | Type | Default value |
---|---|---|
x | int | null |
y | int | null |
click_type | str | click |
delay | float | 0.5 |
param x: | horizontal coordinate |
---|---|
param y: | vertical coordinates |
param click_type: | default click, see RPA.Desktop for different click options |
param delay: | how much in seconds to delay after click, defaults to 0.5 |
Click element
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
index | int | 0 |
action | bool | True |
timeout | int | 10 |
click_type | str | click |
param locator: | element to click |
---|---|
param index: | target element index if multiple are returned |
param action: | call click action on element (default), or use coordinates |
param timeout: | timeout in seconds to find element |
param click_type: | default click, see RPA.Desktop for different click options |
Click element of role push button
Arguments
Argument | Type | Default value |
---|---|---|
button_name | str | null |
param button_name: | name of the button to click |
---|
Close active Java window which has been accessed via `Select Window keyword.
Get list of possible element actions
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
param locator: | target element |
---|
Get element text
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
index | int | 0 |
param locator: | target element |
---|---|
param index: | target element index if multiple are returned |
Get matching elements
Arguments
Argument | Type | Default value |
---|---|---|
locator | str | null |
java_elements | bool | False |
strict | bool | False |
param locator: | elements to get |
---|---|
param java_elements: | if True will return elements as JavaElement on False will return Java ContextNodes |
param strict: | on True all locator matches need to match exactly, on False will be using startsWith matching on non-integer properties |
return: | list of ContextNodes or JavaElements |
Python example.
Robotframework example.
Return Java locator tree as list of objects.
Mostly relevant object properties are:
- ancestry
- role
- name
- description
- indexInParent
return: | list of objects |
---|
Get Java Access Bridge version information
Highlight an element
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
index | int | 0 |
param locator: | element to highlight |
---|---|
param index: | target element index if multiple are returned |
List all available Java windows.
JavaWindow object contains following properties:
- Java process id (pid)
- Java window title
- Java window handle (hwnd)
The pid and title can be used to get control of the Java process by.
return: | list of JavaWindow objects |
---|
Python example.
Robot Framework example.
Print current element into log and possibly into a file
Arguments
Argument | Type | Default value |
---|---|---|
filename | str, None | None |
param filename: | filepath to save element tree |
---|---|
return: | element tree |
Print current Java window locator list into log and possibly into a file.
Arguments
Argument | Type | Default value |
---|---|---|
filename | str, None | None |
param filename: | filepath to save locator tree |
---|---|
return: | locator tree |
Return Java table as list of lists (rows containing columns).
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
visible_only | bool | True |
Each cell element is represented by JavaElement class.
param locator: | locator to match element with type of table |
---|---|
param visible_only: | return all the children when this is False |
return: | list of lists |
Example.
Refresh an element alone.
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
index | int | 0 |
This will ensure the latest data is available in the targeted element, thus gaining speed when dealing with big apps that won't require an entire global refresh. The obtained Java element is returned.
param locator: | element to refresh |
---|---|
param index: | target element index if multiple are returned |
returns: | the Java element found by the passed locator |
Selects Java application window as target for the automation using Java window title.
Arguments
Argument | Type | Default value |
---|---|---|
title | str | null |
bring_foreground | bool | True |
timeout | int | 30 |
param title: | application window title |
---|---|
param bring_foreground: | if application is brought to foreground or not |
param timeout: | selection timeout |
Selects Java application window as target for the automation using Java process ID (pid).
Arguments
Argument | Type | Default value |
---|---|---|
pid | int | null |
bring_foreground | bool | True |
timeout | int | 30 |
param pid: | application process id |
---|---|
param bring_foreground: | if application is brought to foreground or not |
param timeout: | selection timeout |
Selects Java application window as target for the automation using Java window title.
Arguments
Argument | Type | Default value |
---|---|---|
title | str | null |
bring_foreground | bool | True |
timeout | int | 30 |
param title: | application window title |
---|---|
param bring_foreground: | if application is brought to foreground or not |
param timeout: | selection timeout |
Override library display scale factor.
Arguments
Argument | Type | Default value |
---|---|---|
factor | float | null |
Keyword returns previous value.
param factor: | value for the new display scale factor |
---|---|
return: | previous display scale factor value |
Set mouse position to element center
Arguments
Argument | Type | Default value |
---|---|---|
element | ContextNode | null |
param element: | target element |
---|
Call Java Access Bridge process shutdown
Toggle dropdown action on element
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
index | int | 0 |
param locator: | element locator |
---|---|
param index: | target element index if multiple are returned |
Type text into coordinates defined by locator
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
text | str | null |
index | int | 0 |
clear | bool | False |
enter | bool | False |
typing | bool | True |
param locator: | target element |
---|---|
param text: | text to write |
param index: | target element if multiple are returned |
param clear: | should element be cleared before typing |
param enter: | should enter key be pressed after typing |
param typing: | if True (default) will use Desktop().type_text() if False will use Desktop().press_keys() |
Wait until element(s) matching the locator are found within given timeout or raises ElementNotFound exception.
Arguments
Argument | Type | Default value |
---|---|---|
locator | str | null |
timeout | int | 10 |
param locator: | locator to match element |
---|---|
param timeout: | timeout in seconds to find element |
return: | element(s) if found |
Wait until element is focused
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
index | int | 0 |
timeout | float | 0.5 |
param locator: | target element |
---|---|
param index: | target element index if multiple are returned |
param timeout: | timeout in seconds to wait, default 0.5 seconds |
Wait until element text contains expected text
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
text | str | null |
index | int | 0 |
timeout | float | 0.5 |
param locator: | target element |
---|---|
param text: | element text should contain this |
param index: | target element index if multiple are returned |
param timeout: | timeout in seconds to wait, default 0.5 seconds |
Wait until element text equals expected text
Arguments
Argument | Type | Default value |
---|---|---|
locator | ContextNode, JavaElement, str | null |
text | str | null |
index | int | 0 |
timeout | float | 0.5 |
param locator: | target element |
---|---|
param text: | element text should match this |
param index: | target element index if multiple are returned |
param timeout: | timeout in seconds to wait, default 0.5 seconds |