Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cypress get element val and return it

cy.get('app-screen').find('input[id="studentName"]').invoke('val').as('name')
cy.get('@name').then((name) => {
  cy.log('Student Name: ' + name) //prints name
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cypress #element #val #return
ADD COMMENT
Topic
Name
4+6 =