Skip to main content

Click, Type & Form Actions

Actions for clicking, typing, checking boxes, and picking options.

click

Click an element.

Value: string (selector)

<button id="submit-btn">Submit</button>
[
{ "click": "#submit-btn" }
]

Options

OptionTypeDefaultDescription
delaynumber0Wait this many ms before clicking
showClickbooleantrueShow a red ring where it clicks
waitForbooleantrueWait for the element to appear first
timeoutnumber10000How long to wait (ms)
iframestring | string[]Find the element inside an iframe

With delay and custom timeout:

[
{
"click": "button.submit",
"options": { "delay": 500, "timeout": 5000 }
}
]

Using XPath:

[
{ "click": "//button[contains(text(), 'Sign In')]" }
]

Inside an iframe:

[
{
"click": ".inner-button",
"options": { "iframe": "#content-frame" }
}
]

Nested iframes:

[
{
"click": ".deep-button",
"options": { "iframe": ["#outer-frame", "#inner-frame"] }
}
]

hover

Move the mouse over an element without clicking. Useful for opening dropdown menus or tooltips.

Value: string (selector)

<div class="dropdown">
<span class="trigger">Menu</span>
<ul class="items">...</ul>
</div>
[
{ "hover": ".trigger" }
]

Options

Same as click: delay, showClick, waitFor, timeout, iframe.

fill

Type text into an input or textarea, one character at a time. Clears the field first by default.

Value: [selector, text]

<input type="email" name="email" />
[
{ "fill": ["input[name=email]", "user@example.com"] }
]

Options

OptionTypeDefaultDescription
clearbooleantrueClear the field before typing
delaynumber0Wait between each keystroke (ms)
waitForbooleantrueWait for the element to appear
timeoutnumber10000How long to wait
showClickbooleantrueShow visual feedback
iframestring | string[]Find the element inside an iframe

Append to existing text:

[
{
"fill": ["textarea#message", " (edited)"],
"options": { "clear": false }
}
]

Slow typing (simulates human speed):

[
{
"fill": ["input#search", "Hello"],
"options": { "delay": 50 }
}
]

press

Press a key on an element. Use null as the selector to send the key to the whole page.

Value: [selector, key]

<input type="text" id="search" />
[
{ "press": ["#search", "Enter"] }
]

Send a key to the whole page:

[
{ "press": [null, "Escape"] }
]

Modifier keys — use + to combine:

[
{ "press": [null, "Control+a"] },
{ "press": [null, "Control+c"] },
{ "press": ["input", "Shift+Tab"] }
]

Options

Same as click: delay, waitFor, timeout, showClick, iframe.

check

Check a checkbox or radio button. Does nothing if it is already checked.

Value: string (selector)

<input type="checkbox" id="agree-terms" />
<label for="agree-terms">I agree to the terms</label>
[
{ "check": "#agree-terms" }
]

Options

OptionTypeDefaultDescription
checkedbooleantruetrue to check, false to uncheck

uncheck

Uncheck a checkbox. Shorthand for check with checked: false.

Value: string (selector)

<input type="checkbox" id="subscribe" checked />
[
{ "uncheck": "#subscribe" }
]

selectOption

Pick an option from a <select> dropdown. Matches by value attribute by default.

Value: [selector, value]

<select id="country">
<option value="US">United States</option>
<option value="UK">United Kingdom</option>
<option value="JP">Japan</option>
</select>
[
{ "selectOption": ["#country", "US"] }
]

By visible text:

[
{
"selectOption": ["#country", "United States"],
"options": { "by": "text" }
}
]

By index (0-based):

[
{
"selectOption": ["#country", 0],
"options": { "by": "index" }
}
]

Multi-select (pass an array of values):

[
{
"selectOption": ["select#tags", ["javascript", "python", "go"]],
"options": { "by": "text" }
}
]

Options

OptionTypeDefaultDescription
bystring"value"How to match: "value", "text", or "index"