testdriver/scroll-until-text.yaml
Description
Thescroll-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.
Arguments
If the method is
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.Example usage
Protips
- Use unique and specific text to improve detection accuracy.
- Adjust the
distancevalue to control how far the command scrolls before giving up. - If you don’t specify a
distance, the command will scroll 5 clicks at a time, giving up after reaching 100 clicks.
Gotchas
- If the text can’t be located within the specified
distance, the command will fail. - Ensure the text is visible and matches exactly, as variations in font size, style, or screen resolution may affect detection accuracy.
- Note that
textis case-sensitive, so Sign Up and sign up would be treated as different strings.
The
scroll-until-text command is ideal for navigating to elements that are off-screen and can’t be located using other commands.
