# WaitFor is Not working

**URL:** <https://forums.eggplantsoftware.com/t/waitfor-is-not-working/8778>\
**Category:** Eggplant Functional\
**Created:** [March 15, 2024, 6:27pm UTC](https://forums.eggplantsoftware.com/t/waitfor-is-not-working/8778 "2024-03-15T18:27:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EggplantSam](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/e/b38774/32.png) [@EggplantSam](https://forums.eggplantsoftware.com/u/EggplantSam)\
**Post date:** [March 15, 2024, 6:27pm UTC](https://forums.eggplantsoftware.com/t/waitfor-is-not-working/8778/1 "2024-03-15T18:27:46Z")

</div>

Hey there,

I have below line of code to check for an image in SUT and waiting for the image using waitFor:2

If ImageFound(imageName:“My Image Here”, waitFor:2)  
LogSuccess “Success”  
else  
LogError “Error”  
End If

But it appears that, Eggplant becomes busy to identify the image on the SUT for more than 2 seconds mentioned. Due to this, its waiting unnecessarily for about 5 - 10 seconds extra.

In order to confirm this, I have actually used timer to validate that, its waiting for the image for more than 2 seconds.

If waitFor:2 is given then it ahould ideally wait for the image for only 2 seconds and not more than that.

---

<div class="post-metadata">

**Author:** ![DSDeep](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/d/c89c15/32.png) [@DSDeep](https://forums.eggplantsoftware.com/u/DSDeep)\
**Post date:** [March 23, 2024, 4:25pm UTC](https://forums.eggplantsoftware.com/t/waitfor-is-not-working/8778/2 "2024-03-23T16:25:16Z")

</div>

I don’t write my imagefinds like that. I force them to run faster by making them little loops, looking every half a second just a few times. For example:

If imageFound(0.5, “image”) and repeatIndex() \< 5 then  
Log “Found expected image at:” & imagelocation  
else  
Log “Expected image not found within 2 seconds.”  
End If

---

<div class="post-metadata">

**Author:** ![DaveHester](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/davehester/32/104_2.png) [@DaveHester](https://forums.eggplantsoftware.com/u/DaveHester)\
**Post date:** [April 2, 2024, 7:03pm UTC](https://forums.eggplantsoftware.com/t/waitfor-is-not-working/8778/3 "2024-04-02T19:03:59Z")

</div>

I have seen that occasionally with `ImageFound(text:"some text")` but never with an image. Could you provide a sample image to either the forum or your Technical Customer Service Manager?
