Cypress · Function
cy.location
cy.location() reads the active page URL. It returns the whole location object or one URL property, such as pathname, host, or searchParams.
Last updated
- Since
- 15.0.0
Syntax
cy.location()
cy.location(key)
cy.location(options)
cy.location(key, options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
cy.url()cy.hash()cy.origin()