# How can I wait for an object to disappear?

# Problem

I need to wait until an object disappears.

### Context

My application has reports it generates, and it can take time. When a report is generating, an animated Please Wait image and text appears. Once the report is generated, the page loads and the Please Wait image and text goes away.

# Solution

### Option A

Wait until the object is no longer visible, but only wait for a maximum amount of time. Notice the not (!) negating the isVisible statement.

<div id="bkmrk-action-accessor-wait"> <table> <tbody> <tr> <td>**Action**

 </td> <td>**Accessor**

 </td> </tr> <tr> <td> Wait

 </td> <td> 60000,!(isVisible(paragraph("Please Wait")))

 </td> </tr> </tbody> </table>

 </div>### Option B

If you want to wait, as well as check something else while waiting, you could use .wasNotFound() in a While. Note: The Set Search Retries lowered to and then restored after the While completes.

<div id="bkmrk-action-accessor-set-"> <table> <tbody> <tr> <td>**Action**

 </td> <td>**Accessor**

 </td> </tr> <tr> <td>Set Search Retries

 </td> <td>2

 </td> </tr> <tr> <td>While

 </td> <td>!(paragraph("Please Wait").wasNotFound())

 </td> </tr> <tr> <td>Wait

 </td> <td>1000

 </td> </tr> <tr> <td>End While

 </td> <td> </td> </tr> <tr> <td>Set Search Retries

 </td> <td>12

 </td> </tr> </tbody> </table>

 </div><div id="bkmrk-last-updated%3A-june-0">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">June 02, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>