Skip to content

Related to #109. Click() worked in the page, but DOM detached exception is raised #3670

@mpagamici

Description

@mpagamici

Current behavior:

CypressError: `cy.click()` failed because this element is detached from the DOM.

<td _ngcontent-c12="" class="adress">Hauptst...</td>

Cypress requires elements be attached in the DOM to interact with them.

The previous command that ran was:

  > cy.wrap()

This DOM element likely became detached somewhere between the previous and current command.

Common situations why this happens:
  - Your JS framework re-rendered asynchronously
  - Your app code reacted to an event firing and removed the element

You typically need to re-query for the element or add 'guards' which delay Cypress from running new commands.

https://on.cypress.io/element-has-detached-from-dom

Desired behavior:

cy.click() actually didn't fail !
The click() was successfully allowing the re-rendering of my page (during replay), I don't understand why the 'DOM detached' exception is raised. --> Is it possible to suppress the fault ? Can I add an exception handler (catch) to allow my script to continue execution ?

Versions

Chrome 72, Cypress 3.1.5, Mac OS X Mojave

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions