Skip to content

cdp_interact

Interact with React components by testID — press buttons, long-press, type text, scroll. Calls JS handlers directly (not native touch). Reliable for all React-level interactions including elements inside gesture handlers. For native gestures (swipe, drag), use device_swipe/device_press instead.

NameTypeRequiredDefaultConstraintsDescription
action`enum: presslongPresstypeTextscroll`Yes
testIDstringNotestID prop of the target component
accessibilityLabelstringNoaccessibilityLabel prop (used if testID not provided)
textstringNoRequired for typeText: the text to enter
scrollXnumberNoFor scroll: horizontal offset in pixels (default 0)
scrollYnumberNoFor scroll: vertical offset in pixels (default 300)
animatedbooleanNotrueFor scroll: whether to animate
cdp_interact(action: <enum: press | longPress | typeText | scroll>)