Scroll the screen until the specified text is found.
The scroll-until-text
command is used to scroll the screen in a specified direction until the specified text is found. This is useful for navigating to elements that aren’t initially visible on the screen.
Argument | Type | Description |
---|---|---|
text | string | The text to find on the screen. Longer and unique are better. Note this is case sensitive |
direction | string | The direction to scroll. Available directions are: up , down , left , right . |
distance | number | (Optional) The maximum number of pixels to scroll before giving up. Default is 300 . |
method | enum | (Optional) The matching algorithm to use. Possible values are keyboard (default) and mouse . |
keyboard
method will trigger a “find” action (ex: Command + F
) to locate the text, while the mouse
method will use a mouse scroll action only.distance
value to control how far the command scrolls before giving up.distance
, the command will scroll 300 pixels at a time, giving up after 5 attempts.distance
, the command will fail.text
is case-sensitive, so Sign Up and sign up would be treated as different strings.scroll-until-text
command is ideal for navigating to elements that are off-screen and can’t be located using other commands.