Cypress · Middle · Question 42 of 77

What causes "element is detached from the DOM" style failures?

Show the answer

Correct answer: The app re-rendered and replaced the element after it was found

Explanation

Since Cypress 12, queries re-run automatically, which removes most of these. Actions on stale elements can still fail if chains are long.

Further reading

Problem with a question

Cypress · Middle · question 42

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz