简体   繁体   中英

Cypress get value from within

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.

我的代码

Useas

ex:

cy.get('input').as('myInput')

cy.get('@myInput').should('be.visible')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM