I’m trying to store a variable using .as command which stores the data but its returning Null when recalled using This.text
it('store variable',function(){
cy.log('ASDF').as('print')
}
it('print',function(){
cy.log(This.print)
}
>Solution :
It’s because cy.log() does not yield anything. Look at the docs, each command has a Yields section to let you know what gets passed to chained commands like .as().
You want to use cy.wrap() instead.
cy.wrap('ASDF').as('print')
Also don’t use a capital T on this
cy.log(this.print)