Cypress - Selecting Elements
You want to click the second-to-last item in a list of elements matched by
cy.get('.items'). Which command correctly selects this element?cy.get('.items'). Which command correctly selects this element?eq(), where eq(-1) is last, eq(-2) is second-to-last.eq(1) selects second element, not second-to-last. last().prev() is invalid chaining in Cypress. eq(cy.get('.items').length - 2) is invalid because length is not accessible synchronously.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions