Element Interactions

To interact with a GuiElement, from automation angle it must be in an interactable state. In the usual automation code, a test author writes a lot of waiting related code (and let’s not even touch the time.sleep.).

Automatic Contextual Dynamic Waiting

Arjuna does a granular automatic waiting of three types:
  • Waiting for the presence of an element when it is attempting to identify a GuiElement

  • Waiting for the right state (for example, clickability of an GuiElement when you enter text or want to click it)

  • Waiting for interaction to succeed (Arjuna, for example, retries click if interaction exception is raised).

Entering/Setting Text

You can enter text in a text box using enter_text call. It clicks on the element before entering text.


You can set text for an element using the text property. It clicks the element, clears text and then enters the text provided.

element.text = "user"

text is a property of GuiElement. element.text = “some_string” is equivalent of setting text of the text box.

To clear text without entering new text, you can use the clear_text call:


(Single/Double) Clicking an Element


Hovering Actions on an Element


Dragging/Dropping an Element

You can drag an element using drag method by providing an Offset specifying X and Y coordinate offsets as follows:


You can drop an element on another element using drop method by providing the target element and offsets specifying X and Y coordinate offsets as follows:

element.drop(target_element, source_offset=Screen.offset(10,20), target_offset=Screen.offset(30,50))

Here source_offset is from the source element and target_offset is from target element where the element is dropped. None or one or both of these can be provided in the call.

Checking/Unchecking/Toggling a Checkbox

The calls do not change the state if the checkbox is already in target state.


If you want to switch the current state of checbox, use toggle:


Selecting/Deselecting/Toggling an Element

The calls do not change the state if the element is already in target state.


If you want to switch the current state of an element, use toggle: