scrollUntilVisible
Last updated
Was this helpful?
Last updated
Was this helpful?
This is similar to the simple command but will keep scrolling until an element appears in the view hierarchy. Identify the element using a .
An optional number between 0
and 100
. A higher number means faster scrolling. Defaults to 40
.
An optional value in milliseconds. If the target element is not found within the timeout then the command will error. The default value is 20000ms
(20 seconds).
An optional value (DOWN
, UP
, LEFT
or RIGHT
) that sets the direction of the scroll. For example, specifying UP
will scroll towards the top of the screen.
An optional value between 0
and 100
; default 100
. This value determines how much of the element must be visible in the viewport before passing this step.
A boolean argument (True
/False
); default False
. The test runner will attempt to centre the target element in the centre of the viewport. Useful for visual inspection of test output via screenshots or video.
In this example, the test will scroll down very slowly until half the footer of the page appears. If it does not appear within 60 seconds then the step times out.