Reputation: 255
I've been trying to test my app by Cypress. Unfortunately, I encountered a problem with cypress..
I really want save an element that I've found in within
method.
However, there is a problem that I can't get this element - Cypress can't save it to variable ( in my code that's it element
variable ).
Any ideas how can I save anything that I will find in within
to variable that is declared outside the within
method?
I'm talking about find
method.
Upvotes: 1
Views: 618
Reputation: 863
Use as
ex:
cy.get('input').as('myInput')
cy.get('@myInput').should('be.visible')
Upvotes: 1