Skip to content
masterclass Buddy

Cypress · Method

cy.root

cy.root() yields the current root DOM element. It returns <html> by default, or the element scoped by .within().

Last updated

Syntax

cy.root()
cy.root(options)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • .within()
  • cy.get()
  • should()
  • submit()

Source: cy.root() | Cypress API Documentation. Checked 2026-11-03.