Facing cypress error as cy.click() failed because it requires a DOM element. The subject received was: > undefined" after .click( )
on button
it('with select tag test',function(){
cy.visit('https://www.htse.net/')
//pop up message window disappear
cy.wait(2000)
cy.get('.splashPopUp.show > .modal-dialog > .modal-content > .close > span',{timeout: 30000})
//cy.get(" div[class='splashPopUp modal fade show'] span[aria-hidden='true']")
//cy.get("div[class='splashPopUp modal fade show'] button[aria-label='Close']")
cy.wait(2000)
.click()
//.should('be.visible')
// cy.click({ force: true })
/*cy.on('window:alert',(str)=>{
expect(strt).to,equal('Aloha!')
})*/
cy.contains('ALOHA e Komo Mai')
cy.click({ force: true })
})
.click()
is a child command , you need to click on something so it should be preceded by a command that returns an element, like.get()
,.find()
, etc.Ref click command
Looks like you want to click the 'X' top-right of modal,
You can even just click on the gray background