Skip to content
masterclass Buddy

Cypress · Function

cy.url

cy.url() gets the complete URL of the page under test. It yields the URL through the Cypress chain, so use assertions, .then(), or an alias to work with the string.

Last updated

Since
< 0.3.3

Syntax

cy.url()
cy.url(options)

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

Subscribe
  • cy.hash()
  • cy.location()
  • cy.origin()

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