Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

679
Vistas
Facing cypress error as"cy.click() failed because it requires a DOM element. The subject received was: > undefined" after .click( ) on button

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 })
})

   


  
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

.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

Incorrect Usage

cy.click('.btn') // Errors, cannot be chained off 'cy'
cy.window().click() // Errors, 'window' does not yield DOM element

Looks like you want to click the 'X' top-right of modal,

cy.contains('div.modal-dialog', 'Where is all the inventory')
  .find('button.close')
  .click()               // don't use multiple!

You can even just click on the gray background

cy.get('div.splashPopUp')
  .click()
about 4 years ago · Juan Pablo Isaza Denunciar

0

Thanks for guiding me, I applied your suggestions, pop up window disappeared from the home page but facing below mentioned error. Kindly give me some time for its solution also

CypressError

Timed out retrying after 4100ms: cy.click() failed because this element is not visible:

<button type="button" class="close" data-dismiss="modal" aria-label="Close">...</button>

This element <button.close> is not visible because its parent <div#exampleModal.splashPopUp.modal.fade> has CSS property: display: none

Fix this problem, or use {force: true} to disable error checking.Learn more

7 | cy.get('div.modal-dialog') 8 | .find('button.close')

9 | .click({ multiple: true }) | ^

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda