Interactable

Objects that can perform interactions are known as Interactable. Typically, all Elements / WebElements are interactable. Interactable interfaces normally "hide" interactions behind methods like .click() or .fill().

This is the root interface for all other Interactable interfaces such as MouseInteractable or KeyboardInteractable. It makes available generic methods to perform interactions on the corresponding elements.

.perform(interaction)

Performs the specified interaction on the corresponding elements.

Parameter Description
interaction the interaction to perform

.performAndWait(interaction)

Performs the specified asynchronous interaction on the corresponding elements, and waits until it completes.

Parameter Description
interaction the asynchronous interaction

MouseInteractable

Mouse interactions can be performed using this interactable interface. It "hides" mouse interactions under its methods. It mimics most of mouse actions in org.openqa.selenium.interactions.Actions.

.click()

Clicks in the middle of the first matched element.

.clickAndHold()

Clicks (without releasing) at the current mouse location.

.contextClick()

Performs a context-click at middle of the first matched element.

.doubleClick()

Performs a double-click at middle of the first matched element.

.dragAndDrop(target)

A convenience method that performs click-and-hold at the location of the first matched source element, moves to the location of the first matched target element, then releases the mouse.

Parameter Description
target Elements expression to move to and release the mouse at.

.moveTo()

Moves the mouse to the middle of the first matched element.

.release()

Releases the pressed left mouse button at the current mouse location.

KeyboardInteractable

Keyboard interactions can be performed using this interactable interface. It "hides" keyboard interactions under its methods. It mimics most of keyboard actions in org.openqa.selenium.interactions.Actions.

.clear()

Clears all input text in the first matched field.

.fill(text)

Same as #clear() followed by #sendKeys(CharSequence)

Parameter Description
text text to type

.keyDown(keys)

Performs a modifier key press. Does not release the modifier key - subsequent interactions may assume it's kept pressed. Note that the modifier key is never released implicitly - either keyUp(theKey) or sendKeys(Keys.NULL) must be called to release the modifier.

Parameter Description
keys either Keys.SHIFT, Keys.ALT or Keys.CONTROL. If the provided key is none of those, IllegalArgumentException is thrown

.keyUp(keys)

Performs a modifier key press after focusing on an element.

Parameter Description
keys either Keys.SHIFT, Keys.ALT or Keys.CONTROL. If the provided key is none of those, IllegalArgumentException is thrown

.sendKeys(keys)

Sends keys to this element.

Parameter Description
keys keys to send

.type(text)

Same as #sendKeys(CharSequence)

Parameter Description
text text to type

WaitInteractable

Provides wait interaction methods for Minium expressions.

.checkForExistence()

Waits for the existence of the elements expression, that is, that it evaluates into a non-empty set before a timeout occurs. It will return true in case it succeeds, false otherwise. No TimeoutException is thrown in this method.

.checkForUnexistence()

Waits for the unexistence of the elements expression, that is, that it evaluates into a empty set before a timeout occurs. It will return true in case it succeeds, false otherwise. No TimeoutException is thrown in this method.

.waitForExistence()

Waits for the existence of the elements expression, that is, that it evaluates into a non-empty set before a timeout occurs. It will fail with a TimeoutException if no element matches this expression.

.waitForUnexistence()

Waits for the unexistence of the elements expression, that is, that it evaluates into a empty set before a timeout occurs. It will fail with a TimeoutException if some element matches this expression.

.waitTime(time, timeUnit)

Waits for the specified time interval.

Parameter Description
time time to wait
timeUnit time units for the specified time

WebInteractable

Web-specific interactions that can be performed using this interactable interface. It "hides" web-specific interactions under its methods.

.check()

Checks the corresponding input, in case it is unchecked.

.close()

Closes the browser window for the corresponding element.

.deselect(text)

Deselects the option with the corresponding text.

Parameter Description
text text of the option to deselect

.deselectAll()

Deselects all options (for multi-select field).

.deselectVal(value)

Deselects the option with the corresponding value.

Parameter Description
value value of the option to deselect

.scrollIntoView()

Scrolls the corresponding element into view.

.select(text)

Selects the option with the corresponding text.

Parameter Description
text text of the option to select

.selectAll()

Selects all options (for multi-select field).

.selectVal(value)

Selects the option with the corresponding value.

Parameter Description
value value of the option to select

.submit()

Submits the corresponding form. Mimics org.openqa.selenium.WebElement#submit().

.uncheck()

Unchecks the corresponding input, in case it is checked.