Interaction
Tools for tapping, swiping, typing text, sending key events, pressing hardware buttons, and scrolling.
tap
Tap at a point on the screen. Supports long press via duration.
Parameters
Example
Tips
- Typical workflow:
query_selector→ getmeasure→ compute center (pageX + width/2,pageY + height/2) →tap. - Coordinates are in points (dp), not pixels. Android pixel conversion is automatic.
- Use
iosOrientationwhen auto-detection fails in landscape mode.
swipe
Swipe from one point to another. Useful for scrolling, opening drawers, or dismissing elements.
Parameters
Example
Tips
- For vertical scroll: keep
x1 = x2, changey1andy2. - Longer
durationvalues produce slower swipes (useful for drag operations). - Prefer
scroll_until_visiblewhen you need to find a specific element in a long list.
input_text
Type text into the currently focused input. ASCII only — use type_text for Unicode/Korean.
Parameters
Example
Tips
- The input field must be focused first (tap on it before typing).
- Special characters are escaped automatically on Android.
- For non-ASCII text (Korean, emoji, etc.), use
type_textinstead.
type_text
Type text into a TextInput by UID. Supports Unicode including Korean, emoji, etc.
Parameters
Example
Tips
- Unlike
input_text, this doesn't require the field to be focused — it targets by UID directly. - Internally calls
onChangeText+setNativePropson the TextInput via the runtime. - Get the UID from
query_selectorfirst:query_selector({ selector: "TextInput" }).
input_key
Send a keycode to the simulator/device.
Parameters
Common Keycodes
Example
press_button
Press a physical/hardware button on the device.
Parameters
Available Buttons
Example
scroll_until_visible
Scroll until a target element becomes visible. Combines query_selector + swipe in a loop.
Parameters
Example
Tips
- Use
scrollableSelectorwhen there are multiple scroll containers on screen. - After finding the element, you can immediately
tapusing the returned coordinates. - If
passisfalse, the element was not found withinmaxScrollsattempts.
switch_keyboard
Switch the active keyboard on simulator/emulator.
Parameters
Example
Tips
- iOS:
switchsends Ctrl+Space to toggle between keyboards. - Switch the keyboard before using
input_textto ensure the correct layout.