**Here i attach my html code's image.**
[![enter image description here](https://i.stack.imgur.com/t20Wr.png)](https://i.stack.imgur.com/t20Wr.png)

I want to click on all '.close-img' element which is in its parent div '.product-list-sidebar'.

**This is my code**

```
cy.wait(5000)

cy.get('.close-img').click({multiple:true})

```

**This is the error which i get from cypress**

Timed out retrying after 4100ms: cy.click() failed because this element is detached from the DOM.

...

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

The previous command that ran was:

```
 > cy.get()

```

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.Learn more

```
cypress/integration/Shirtee/DesignerAllSteps.js:47:26
  45 |    // cy.clearCookies()
  46 |     cy.wait(5000)
> 47 |     cy.get('.close-img').click({multiple:true})
     |                          ^
  48 | })
  49 | 
  50 |

```