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 | Description |
---|---|---|---|
locator | str | null | target element |
action | str | null | name of the element action to call |
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 | Description |
---|---|---|---|
x | int | null | horizontal coordinate |
y | int | null | vertical coordinates |
click_type | str | click | default click, see RPA.Desktop for different click options |
delay | float | 0.5 | how much in seconds to delay after click, defaults to 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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | element to click |
index | int | 0 | target element index if multiple are returned |
action | bool | True | call click action on element (default), or use coordinates |
timeout | int | 10 | timeout in seconds to find element |
click_type | str | click | default click, see RPA.Desktop for different click options |
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 | Description |
---|---|---|---|
button_name | str | null | name of the button to click |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | target element |
param locator: | target element |
---|
Get element text
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | target element |
index | int | 0 | target element index if multiple are returned |
param locator: | target element |
---|---|
param index: | target element index if multiple are returned |
Get matching elements
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | str | null | elements to get |
java_elements | bool | False | if True will return elements as JavaElement on False will return Java ContextNodes |
strict | bool | False | on True all locator matches need to match exactly, on False will be using startsWith matching on non-integer properties |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | element to highlight |
index | int | 0 | target element index if multiple are returned |
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 | Description |
---|---|---|---|
filename | str, None | None | filepath to save element tree |
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 | Description |
---|---|---|---|
filename | str, None | None | filepath to save locator tree |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | locator to match element with type of table |
Each cell element is represented by JavaElement class.
param locator: | locator to match element with type of table |
---|---|
return: | list of lists |
Example.
Selects Java application window as target for the automation using Java window title.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
title | str | null | application window title |
bring_foreground | bool | True | if application is brought to foreground or not |
timeout | int | 30 | selection timeout |
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 | Description |
---|---|---|---|
pid | int | null | application process id |
bring_foreground | bool | True | if application is brought to foreground or not |
timeout | int | 30 | selection timeout |
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 | Description |
---|---|---|---|
title | str | null | application window title |
bring_foreground | bool | True | if application is brought to foreground or not |
timeout | int | 30 | selection timeout |
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 | Description |
---|---|---|---|
factor | float | null | value for the new display scale factor |
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 | Description |
---|---|---|---|
element | ContextNode | null | target element |
param element: | target element |
---|
Call Java Access Bridge process shutdown
Toggle dropdown action on element
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | element locator |
index | int | 0 | target element index if multiple are returned |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | target element |
text | str | null | text to write |
index | int | 0 | target element if multiple are returned |
clear | bool | False | should element be cleared before typing |
enter | bool | False | should enter key be pressed after typing |
typing | bool | True | if True (default) will use Desktop().type_text() if False will use Desktop().press_keys() |
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 | Description |
---|---|---|---|
locator | str | null | locator to match element |
timeout | int | 10 | timeout in seconds to find element |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | target element |
index | int | 0 | target element index if multiple are returned |
timeout | float | 0.5 | timeout in seconds to wait, default 0.5 seconds |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | target element |
text | str | null | element text should contain this |
index | int | 0 | target element index if multiple are returned |
timeout | float | 0.5 | timeout in seconds to wait, default 0.5 seconds |
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 | Description |
---|---|---|---|
locator | ContextNode, JavaElement, str | null | target element |
text | str | null | element text should match this |
index | int | 0 | target element index if multiple are returned |
timeout | float | 0.5 | timeout in seconds to wait, default 0.5 seconds |
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 |