Scroll the screen until the specified text is found.
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 | (Optional) The direction to scroll. Available directions are: up , down , left , right . Defaults to down . |
method | string | (Optional) The method to use to scroll the page. Available methods are: mouse and keyboard . Defaults to keyboard . |
distance | number | (Optional) The maximum number of pixels to scroll before giving up. Default is 10000 . |
keyboard
it just searches for the string by doing ctrl + f
.
This is helpful if there is a single string match that you want to operate with.If you are using mouse
method, the command will manually scroll the page (based on the distance
) until the text is found.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.