Cypress · Method
cy.scrollTo
cy.scrollTo() moves the window or a scrollable element to a named position or coordinate. It supports pixel and percentage values, animation options, and a scrollability check.
Last updated
- Since
- 4.11.0
Syntax
cy.scrollTo(position)
cy.scrollTo(x, y)
cy.scrollTo(position, options)
cy.scrollTo(x, y, options)
.scrollTo(position)
.scrollTo(x, y)
.scrollTo(position, options)
.scrollTo(x, y, options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
.scrollIntoView()cy.window()cy.viewport()