Application Refresh

Refresh application element tree

Might be required action after application element structure changes after window refresh.

Call Element Action

Call element action

Arguments

Argument Type Default value Description
locatorstrnulltarget element
actionstrnullname of the element action to call
param locator:target element
param action:name of the element action to call

Click Coordinates

Keyword to mouse click at specific coordinates.

Arguments

Argument Type Default value Description
xintnullhorizontal coordinate
yintnullvertical coordinates
click_typestrclickdefault click, see RPA.Desktop for different click options
delayfloat0.5how 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

Click element

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnull
indexint0target element index if multiple are returned
actionboolTruecall click action on element (default), or use coordinates
timeoutint10timeout in seconds to find element
param target: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

Click Push Button

Click element of role push button

Arguments

Argument Type Default value Description
button_namestrnullname of the button to click
param button_name:
 name of the button to click

Close Java Window

Close active Java window which has been accessed via `Select Window keyword.

Get Element Actions

Get list of possible element actions

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulltarget element
param locator:target element

Get Element Text

Get element text

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulltarget element
indexint0target element index if multiple are returned
param locator:target element
param index:target element index if multiple are returned

Get Elements

Get matching elements

Arguments

Argument Type Default value Description
locatorstrnullelements to get
java_elementsboolFalseif True will return elements as JavaElement on False will return Java ContextNodes
strictboolFalseon 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.


elements = java.get_elements("name:common", java_elements=True)
for e in elements:
    print(e.name if e.name else "EMPTY", e.visible, e.x, e.y)
    if e.role == "check box":
        e.click()
    else:
        java.type_text(e, "new content", clear=True, typing=False)

# following does NOT return anything because search is strict
# and there are no 'push butto' role
elements = java.get_elements("role:push butto", strict=True)

Robotframework example.


${elements}=    Get Elements
...    role:push button and name:Send
...    java_elements=True
Evaluate   $elements[0].click()
Click Element    ${elements}[0]    action=False
Type Text
...    ${elements}[0]
...    moretext
...    clear=True
...    typing=False

Get Version Info

Get Java Access Bridge version information

Highlight Element

Highlight an element

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnullelement to highlight
indexint0target element index if multiple are returned
param locator:element to highlight
param index:target element index if multiple are returned

Press Keys

Press multiple keys down simultaneously

Arguments

Argument Type Default value Description
keysnullkeys to press

See Desktop library documentation for supported keys

param keys:keys to press

Read Table

Return Java table as list of lists (rows containing columns).

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulllocator 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.


table = java.read_table(locator_table)
for row in table:
    for cell in row:
        if cell.role == "check box":
            print(cell.row, cell.col, str(cell.checked))
        else:
            print(cell.row, cell.col, cell.name)

Select Menu

Select menu by clicking menu elements

Arguments

Argument Type Default value Description
menustrnullname of the menu
menuitemstrnullname of the menu item
param menu:name of the menu
param menuitem:name of the menu item

Select Window

Selects Java application window as target for the automation

Arguments

Argument Type Default value Description
titlestrnullapplication window title
bring_foregroundboolTrueif application is brought to foreground or not
timeoutint30selection timeout
param title:application window title
param bring_foreground:
 if application is brought to foreground or not
param timeout:selection timeout

Set Display Scale Factor

Override library display scale factor.

Arguments

Argument Type Default value Description
factorfloatnullvalue 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

Set mouse position to element center

Arguments

Argument Type Default value Description
elementContextNodenulltarget element
param element:target element

Shutdown Jab

Call Java Access Bridge process shutdown

Toggle Drop Down

Toggle dropdown action on element

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnullelement locator
indexint0target element index if multiple are returned
param locator:element locator
param index:target element index if multiple are returned

Type Text

Type text into coordinates defined by locator

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulltarget element
textstrnulltext to write
indexint0target element if multiple are returned
clearboolFalseshould element be cleared before typing
enterboolFalseshould enter key be pressed after typing
typingboolTrueif 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 Is Focused

Wait until element is focused

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulltarget element
indexint0target element index if multiple are returned
timeoutfloat0.5timeout 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

Wait until element text contains expected text

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulltarget element
textstrnullelement text should contain this
indexint0target element index if multiple are returned
timeoutfloat0.5timeout 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

Wait until element text equals expected text

Arguments

Argument Type Default value Description
locatorContextNode, JavaElement, strnulltarget element
textstrnullelement text should match this
indexint0target element index if multiple are returned
timeoutfloat0.5timeout 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