Skip to main content

Overview

Interaction commands allow you to simulate user interactions with page elements.

Mouse Interactions

click

Click an element.
ParameterDescription
selectorCSS selector, ref (@e1), or text locator
Options:
OptionDescription
—new-tabOpen link in new tab
Examples:

dblclick

Double-click an element.
ParameterDescription
selectorElement selector
Examples:

hover

Hover over an element.
ParameterDescription
selectorElement selector
Examples:

focus

Focus an element.
ParameterDescription
selectorElement selector
Examples:

Text Input

fill

Clear and fill an input field.
ParameterDescription
selectorInput element selector
textText to fill (multiple words joined with spaces)
Examples:

type

Type text into an element (without clearing).
ParameterDescription
selectorInput element selector
textText to type
Examples:

press

Press a keyboard key.
ParameterDescription
keyKey name (Enter, Tab, Escape) or key combination (Control+a)
Alias: key Examples:

keyboard type

Type text with real keystrokes (current focus).
ParameterDescription
textText to type
Examples:

keyboard inserttext

Insert text without key events (current focus).
ParameterDescription
textText to insert
Examples:

Form Controls

check

Check a checkbox.
ParameterDescription
selectorCheckbox selector
Examples:

uncheck

Uncheck a checkbox.
ParameterDescription
selectorCheckbox selector
Examples:

select

Select dropdown option(s).
ParameterDescription
selectorSelect element selector
valueOption value(s) to select
Examples:

Scrolling

scroll

Scroll the page or an element.
ParameterDescription
directionDirection: up, down, left, right (default: down)
amountPixels to scroll (default: 300)
Options:
OptionDescription
-s, —selectorScroll specific element instead of page
Examples:

scrollintoview

Scroll element into view.
ParameterDescription
selectorElement selector
Alias: scrollinto Examples:

Drag and Drop

drag

Drag an element to another element.
ParameterDescription
sourceSource element selector
targetTarget element selector
Examples:

File Upload

upload

Upload file(s) to an input element.
ParameterDescription
selectorFile input selector
filesFile path(s) to upload
Examples:

Workflow Examples

Login Form

Search and Navigate

Form with Dropdowns