# Default WaitFor seconds

**URL:** <https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095>\
**Category:** Eggplant Functional\
**Tags:** script, sensetalk, eggplant-functional\
**Created:** [September 19, 2024, 7:29pm UTC](https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095 "2024-09-19T19:29:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scsvel](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/scsvel/32/316_2.png) [@scsvel](https://forums.eggplantsoftware.com/u/scsvel)\
**Post date:** [September 19, 2024, 7:29pm UTC](https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095/1 "2024-09-19T19:29:21Z")

</div>

**Couple of usage Questions:**

1. Is there a way to set/change the default value to wait for an image or text without explicitly specifying the WaitFor property on each and every command like Click, ImageFound, etc.

2. Can we specify the parameters without specifying the property name like:

```auto
Click secs_to_wait, "my text on screen", some_rect

--instead of
Click WaitFor: secs_to_wait, text: "my text on screen", SearchRectangle: some_rect

```

Appreciate any inputs.

---

<div class="post-metadata">

**Author:** ![Karsten](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/k/e47c2d/32.png) [@Karsten](https://forums.eggplantsoftware.com/u/Karsten)\
**Post date:** [September 20, 2024, 11:53am UTC](https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095/2 "2024-09-20T11:53:18Z")

</div>

Hey @scsvel,

Open the eggplant \> Preferences \> Run \> Screen  
The three options in the Search Timing influence the default behavior.  
 ![image](https://forums.eggplantsoftware.com/uploads/default/original/1X/6dd9f8612ea07f435bbfedd76e99b422e387e561.png)

I hope I get the math right 😉  
It should be for images  
([image Search Time](https://docs.eggplantsoftware.com/studio/stk-run-options-properties/#the-imagesearchtime) + [Search Delay](https://docs.eggplantsoftware.com/studio/stk-run-options-properties/#the-imagesearchdelay)) \* [Search Count](https://docs.eggplantsoftware.com/studio/stk-run-options-properties/#the-imagesearchcount) = total waitfor time

For text it is not directly influenceable as the OCR engine processing time does vary according to text on screen.

Cheers,  
Karsten

---

<div class="post-metadata">

**Author:** ![SenseTalkDoug](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/sensetalkdoug/32/88_2.png) [@SenseTalkDoug](https://forums.eggplantsoftware.com/u/SenseTalkDoug)\
**Post date:** [October 1, 2024, 9:48pm UTC](https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095/3 "2024-10-01T21:48:40Z")

</div>

Actually, the math is a bit different. 😀  
The correct formula is:  
`ImageSearchTime = ImageSearchDelay * (ImageSearchCount - 1)`  
If you play with the numbers on that panel you’ll see that they always maintain that relationship.  
The actual time that Eggplant spends searching for an element on the screen is not entirely predictable because it depends on how long it takes to search the screen once. Basically, it scans the screen for the image or text it is looking for. If it’s found, we’re done. Otherwise, if the ImageSearchDelay time hasn’t already passed, we wait that long and then the screen is refreshed (updated from the SUT). We repeat this until we have searched the screen ImageSearchCount times.  
So, the total time spent on a _failed_ search is at least the ImageSearchTime (or the WaitFor time if it is given) but usually somewhat longer.

---

<div class="post-metadata">

**Author:** ![scsvel](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/scsvel/32/316_2.png) [@scsvel](https://forums.eggplantsoftware.com/u/scsvel)\
**Post date:** [October 2, 2024, 11:35am UTC](https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095/4 "2024-10-02T11:35:25Z")

</div>

Thanks. This will be helpful for me.

I understand the timing would be little extra/less based on Eggplant screen processing but setting up approx. max wait time using these is helpful for me as no need to pass everytime in each command line using WaitFor property unless I want a different waitfor value.

---

<div class="post-metadata">

**Author:** ![SenseTalkDoug](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/sensetalkdoug/32/88_2.png) [@SenseTalkDoug](https://forums.eggplantsoftware.com/u/SenseTalkDoug)\
**Post date:** [October 2, 2024, 3:19pm UTC](https://forums.eggplantsoftware.com/t/default-waitfor-seconds/14095/5 "2024-10-02T15:19:13Z")

</div>

Exactly. ImageSearchTime (and its component parts) provide the default behavior, and the WaitFor property on a specific search will override that.
