Cypress · Matcher
have.length
have.length checks that a Cypress subject has an exact length. It is commonly used with cy.get() to verify the number of matching elements.
Last updated
Syntax
cy.get(selector).should('have.length', expectedLength)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
cy.getshouldandnot.have.length