# WaitForElement - Don't wait

**URL:** <https://forum.katalon.com/t/waitforelement-dont-wait/85105>\
**Category:** API Testing\
**Tags:** mobile-testing, api-testing, katalon-studio\
**Created:** [March 9, 2023, 8:22am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105 "2023-03-09T08:22:39Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanh.tung.170861](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanh.tung.170861/32/18765_2.png) [@thanh.tung.170861](https://forum.katalon.com/u/thanh.tung.170861)\
**Post date:** [March 9, 2023, 8:22am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/1 "2023-03-09T08:22:40Z")

</div>

I am also facing the same problem as in this topic [WaitForElement - does not work as required](http://forum.katalon.com/t/waitforelement-does-not-work-as-required/8805)

I don’t understand why the wait function doesn’t wait according to the timeout set in the function(10 seconds). The wait function seems to just wait 1 second and then finish  
I’m sure my path in findTestObject(…) is correct. Because I tried waiting in case the object already exists and the wait function found it.  
If the object already exists and the wait function only works, then this function has no meaning anymore

Anyone who had the same problem as me and had a solution, let me know  
Please!!!

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 9, 2023, 8:52am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/2 "2023-03-09T08:52:22Z")

</div>

Please create a sample Test Case that is runnable on other’s machine. The sample should reproduce your findings. Without a runnable sample code, it is difficulut to discuss productively.

---

<div class="post-metadata">

**Author:** ![thanh.tung.170861](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanh.tung.170861/32/18765_2.png) [@thanh.tung.170861](https://forum.katalon.com/u/thanh.tung.170861)\
**Post date:** [June 18, 2023, 8:26am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/3 "2023-06-18T08:26:34Z")

</div>

After much testing, I noticed that this problem appears on Hybrid applications.  
Specifically, on page Login (with format web\_app), you create a wait() function to wait for an object to exist on page Home (with native\_app format). When page Home starts to load, the wait() function immediately stops and returns no object found even though there is still some time to wait.  
The wait() function must wait for the “timeout” that I have set up. But no, the wait is not done yet, the wait() function to return a result that is not found  
With sample code, it’s just Katalon’s “Wait for Element Present” function

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [June 18, 2023, 11:07pm UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/4 "2023-06-18T23:07:53Z")

</div>

@thanh.tung.170861

Which version of Katalon Studio do you use?

Prior to v8.6.5 (possibly sinice v8.6.0) , `WebUI.waitForElementPresent` had a problem; it doesn’t wait at all.

[http://forum.katalon.com/t/waitforelementpresent-doesnt-seem-to-be-waiting-any-more/86718/3](http://forum.katalon.com/t/waitforelementpresent-doesnt-seem-to-be-waiting-any-more/86718/3)

As the relase note v8.6.5 says, the problem should have been fixed at v8.6.5.

[http://forum.katalon.com/t/new-release-katalon-platform-update-may-31-2023/89214](http://forum.katalon.com/t/new-release-katalon-platform-update-may-31-2023/89214)

Why not you try it?

---

<div class="post-metadata">

**Author:** ![thanh.tung.170861](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanh.tung.170861/32/18765_2.png) [@thanh.tung.170861](https://forum.katalon.com/u/thanh.tung.170861)\
**Post date:** [September 18, 2023, 9:32am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/5 "2023-09-18T09:32:27Z")

</div>

I tried with version 8.6.6, this problem still exists  
The waitForElementNotPresent function still ends before the timeout expires  
I set the timeout to 60 seconds, the wait function ends after 11 seconds(the same time when the application switches to a new page).  
 → And of course the returned result is: Element ‘Object Repository/.etc.’ is present

---

<div class="post-metadata">

**Author:** ![Monty\_Bagati](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/monty_bagati/32/33047_2.png) [@Monty\_Bagati](https://forum.katalon.com/u/Monty_Bagati)\
**Post date:** [September 18, 2023, 10:36am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/6 "2023-09-18T10:36:20Z")

</div>

Could you please use the other strategies. It is possible that the element is simply being hidden from the view but not actually being removed from the DOM

1. waitForElementVisible
2. waitForElementClickable

Let me know if it works for you

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 18, 2023, 11:12am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/7 "2023-09-18T11:12:30Z")

</div>

> [@thanh.tung.170861](#):
>
> The waitForElementNotPresent function still ends before the timeout expires  
> I set the timeout to 60 seconds, the wait function ends after 11 seconds(the same time when the application switches to a new page).

？？？ I think that the keyword is working as specified. Why do you think “the problem still exists” ?

The waitForElementNotPresent keyword will end as soon as the target element disappers. When the application switches to a new page after 11 seconds, the target element disappers. So the keyword will end. The keyword will wait until the timeout expires only when the target element remains present.

I am afraid that you misunderstood what the keyword does. The name “…NotPresent” might have confused you. The “waitForElementNotPresent” should rather be known as “ **waitForElementToDisappear** ”.

---

<div class="post-metadata">

**Author:** ![thanh.tung.170861](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanh.tung.170861/32/18765_2.png) [@thanh.tung.170861](https://forum.katalon.com/u/thanh.tung.170861)\
**Post date:** [June 12, 2025, 8:27am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/8 "2025-06-12T08:27:13Z")

</div>

![waitForElementNotPresent_strange](https://europe1.discourse-cdn.com/katalon/original/3X/e/7/e7679666c7a1c2e460be0d6736261b0fa648623b.png)

In the image above you can see:  
I set the timeout to 20s, but the method **waitForElementNotPresent** only waits 0.319s

Does anyone know why?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [June 12, 2025, 11:26am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/9 "2025-06-12T11:26:13Z")

</div>

I believe, `Mobile.waitForElementNotPresent` keyword is just buggy.

→ @Elly_Tran

The following is the source code of `com.kms.katalon.core.mobile.keyword.builtin.WaitForElementNotPresentKeyword` of Katalon Studio v10.2.0:

```auto
package com.kms.katalon.core.mobile.keyword.builtin

import groovy.transform.CompileStatic

import java.text.MessageFormat

import org.openqa.selenium.WebElement

import com.kms.katalon.core.annotation.internal.Action
import com.kms.katalon.core.mobile.keyword.internal.MobileAbstractKeyword
import com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain
import com.kms.katalon.core.keyword.internal.AbstractKeyword
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.exception.StepFailedException
import com.kms.katalon.core.keyword.internal.SupportLevel
import com.kms.katalon.core.helper.KeywordHelper
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.mobile.constants.StringConstants

@Action(value = "waitForElementNotPresent")
public class WaitForElementNotPresentKeyword extends MobileAbstractKeyword {
    
    @CompileStatic
    @Override
    public SupportLevel getSupportLevel(Object ...params) {
        return super.getSupportLevel(params)
    }

    @CompileStatic
    @Override
    public Object execute(Object ...params) {
        TestObject to = getTestObject(params[0])
        int timeout = (int) params[1]
        FailureHandling flowControl = (FailureHandling)(params.length > 2 && params[2] instanceof FailureHandling ? params[2] : RunConfiguration.getDefaultFailureHandling())
        return waitForElementNotPresent(to, timeout, flowControl);
    }
    
    @CompileStatic
    public boolean waitForElementNotPresent(TestObject to, int timeout, FailureHandling flowControl) throws StepFailedException {
        return MobileKeywordMain.runKeyword({
            KeywordHelper.checkTestObjectParameter(to)
            timeout = KeywordHelper.checkTimeout(timeout)
            WebElement element = findElement(to, timeout * 1000)
            if (element == null) {
                logger.logPassed(MessageFormat.format(StringConstants.KW_LOG_PASSED_ELEMENT_NOT_PRESENTED, to.getObjectId()))
                return true
            } else {
                logger.logWarning(MessageFormat.format(StringConstants.KW_LOG_PASSED_ELEMENT_PRESENTED, to.getObjectId()))
                return false
            }
        }, flowControl, RunConfiguration.getTakeScreenshotOption(), to != null ? MessageFormat.format(StringConstants.KW_MSG_FAILED_TO_WAIT_FOR_ELEMENT_X_NOT_PRESENT, to.getObjectId()) : StringConstants.KW_MSG_FAILED_TO_WAIT_FOR_ELEMENT_NOT_PRESENT)
    }
    
}

```

The `Mobile.waitForElementNotPresent` methos is NOT waiting at all. When the target element is found present in the page, this keyword will quickly return false with message “the element is present”.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [June 12, 2025, 12:08pm UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/10 "2025-06-12T12:08:44Z")

</div>

> [@kazurayam](#):
>
> > [@thanh.tung.170861](#):
> >
> > The waitForElementNotPresent function still ends before the timeout expires  
> > I set the timeout to 60 seconds, the wait function ends after 11 seconds(the same time when the application switches to a new page).
> 
> ？？？ I think that the keyword is working as specified. Why do you think “the problem still exists” ?

When I wrote this in Sep 2023, I was talking about the `WebUI.waitForElementPresent` keyword which worked fine.

Now, @thanh.tung.170861 showed his/her testcase script for the first time. I was surprised to find that his/her script was calling `Mobile.waitForElementNotPresent` keyword, which is buggy.

---

<div class="post-metadata">

**Author:** ![Elly\_Tran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/elly_tran/32/21874_2.png) [@Elly\_Tran](https://forum.katalon.com/u/Elly_Tran)\
**Post date:** [June 13, 2025, 9:33am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/12 "2025-06-13T09:33:47Z")

</div>

Hi all,

Thank you for reporting this. I have created the ticket for this and be back with any update soon.

---

<div class="post-metadata">

**Author:** ![Elly\_Tran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/elly_tran/32/21874_2.png) [@Elly\_Tran](https://forum.katalon.com/u/Elly_Tran)\
**Post date:** [October 7, 2025, 9:54am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/13 "2025-10-07T09:54:50Z")

</div>

Hi all,

Please help try to resolve this issue with our latest version 10.3.2 and let us know if it works/not work. Thank you

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 7, 2025, 1:43pm UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/14 "2025-10-07T13:43:51Z")

</div>

I made a diff to compare v10.2.4 and v10.3.0’s sources of `Mobile.waitForElementNotPresent` keyword:

```auto
--- /Users/kazurayam/katalon-workspace/katalon-studio-sources/versions/10.2.4/resources/source/com.kms.katalon.core.mobile/com/kms/katalon/core/mobile/keyword/builtin/WaitForElementNotPresentKeyword.groovy
+++ /Users/kazurayam/katalon-workspace/katalon-studio-sources/versions/10.3.0/resources/source/com.kms.katalon.core.mobile/com/kms/katalon/core/mobile/keyword/builtin/WaitForElementNotPresentKeyword.groovy
@@ -4,1 +4,0 @@
-
@@ -6,1 +5,2 @@
-
+import java.time.Duration
+import org.openqa.selenium.TimeoutException
@@ -8,1 +8,2 @@
-
+import org.openqa.selenium.support.ui.FluentWait
+import com.google.common.base.Function
@@ -10,5 +11,1 @@
-import com.kms.katalon.core.mobile.keyword.internal.MobileAbstractKeyword
-import com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain
-import com.kms.katalon.core.keyword.internal.AbstractKeyword
-import com.kms.katalon.core.testobject.TestObject
-import com.kms.katalon.core.model.FailureHandling
+import com.kms.katalon.core.configuration.RunConfiguration
@@ -16,1 +13,0 @@
-import com.kms.katalon.core.keyword.internal.SupportLevel
@@ -18,1 +14,1 @@
-import com.kms.katalon.core.configuration.RunConfiguration
+import com.kms.katalon.core.keyword.internal.SupportLevel
@@ -20,0 +16,4 @@
+import com.kms.katalon.core.mobile.keyword.internal.MobileAbstractKeyword
+import com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain
+import com.kms.katalon.core.model.FailureHandling
+import com.kms.katalon.core.testobject.TestObject
@@ -21,0 +21,2 @@
+import groovy.transform.CompileStatic
+
@@ -44,2 +46,34 @@
- WebElement element = findElement(to, timeout * 1000)
- if (element == null) {
+
+ boolean elementNotFound = false
+ try {
+ // In theory, it should take 1.5 seconds each time it finds the element
+ // (1s to search and 500ms to sleep). But in reality, finding the element can take longer than 1s
+ // because the core implementation of `findElement` method (`findElementsByLocatorStrategy` method in MobileCommonHelper class)
+ // only checks the timeout after finding
+ elementNotFound = new FluentWait<TestObject>(to)
+ .pollingEvery(Duration.ofMillis(500))
+ .withTimeout(Duration.ofSeconds(timeout))
+ .until(new Function<TestObject, Boolean>() {
+ @Override
+ public Boolean apply(TestObject testObj) {
+ try {
+ // Set timeout to 1 second to ensure that the `findElementsByLocatorStrategy` method in MobileCommonHelper class
+ // runs at least once with the minimum timeout.
+ // Note: Do not set the timeout to 0, as the `checkTimeout` method in the `KeywordHelper` class
+ // will reset it to the default value (30 seconds) if the timeout is less than or equal to zero.
+ WebElement element = findElement(testObj, 1)
+ if (element == null) {
+ return true
+ }
+ } catch (NoSuchElementException e) {
+ return true
+ }
+
+ return false
+ }
+ })
+ } catch (TimeoutException e) {
+ // timeOut, do nothing
+ }
+
+ if (elementNotFound) {
@@ -47,1 +81,0 @@
- return true
@@ -50,1 +83,0 @@
- return false
@@ -52,0 +84,2 @@
+
+ return elementNotFound
@@ -54,1 +88,0 @@
-

```

As far as I see the source, it seems that the `Mobile.waitForElementNotPresent` keyword of v10.3.0 and newer is doing some “wait”.

But I am not sure how the keyword actually works. I can not run the keyword as I don’t have any Mobile project.

---

<div class="post-metadata">

**Author:** ![nghi.phan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nghi.phan/32/30970_2.png) [@nghi.phan](https://forum.katalon.com/u/nghi.phan)\
**Post date:** [July 17, 2026, 4:34am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/15 "2026-07-17T04:34:40Z")

</div>

Hell Mr Kazu,

I know it has been awhile, but we would like to double check if the issue still persist?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 17, 2026, 6:55am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/16 "2026-07-17T06:55:35Z")

</div>

> [@nghi.phan](#):
>
> but we would like to double check if the issue still persist?

I don’t know. I am not willing to check the Mobile.\* keywords.

---

<div class="post-metadata">

**Author:** ![arvind.choudhary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arvind.choudhary/32/33165_2.png) [@arvind.choudhary](https://forum.katalon.com/u/arvind.choudhary)\
**Post date:** [July 17, 2026, 7:29am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/17 "2026-07-17T07:29:01Z")

</div>

Hmm this still happens, I guess. While automating sometime I still encounter this error — that Unable to wait. Wait Bella, let me check in history I will confirm

---

<div class="post-metadata">

**Author:** ![arvind.choudhary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arvind.choudhary/32/33165_2.png) [@arvind.choudhary](https://forum.katalon.com/u/arvind.choudhary)\
**Post date:** [July 17, 2026, 7:33am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/18 "2026-07-17T07:33:57Z")

</div>

And even the " **Katalon studio getting crashed issue"** is still there, not resolved yet. Me and my team members are using the latest version and even in the middle of work the studio get crashed and closed off. This doesn’t happen every time, but it occurs.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 17, 2026, 12:31pm UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/19 "2026-07-17T12:31:54Z")

</div>

> [@arvind.choudhary](#):
>
> And even the " **Katalon studio getting crashed issue"** is still there, not resolved yet.

Is this a new topic?  
Or is it the one you already reported in another topic? If so please show the URL to link for reference, please.

---

<div class="post-metadata">

**Author:** ![arvind.choudhary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arvind.choudhary/32/33165_2.png) [@arvind.choudhary](https://forum.katalon.com/u/arvind.choudhary)\
**Post date:** [July 20, 2026, 7:07am UTC](https://forum.katalon.com/t/waitforelement-dont-wait/85105/20 "2026-07-20T07:07:31Z")

</div>

No @kazurayam this is not a new topic. We had previously encountered an issue where Katalon Studio would unexpectedly crash and close while users were working or automating tests. The Katalon team had fixed that issue at the time.

Recently, our team has started seeing similar behavior again. It is not very frequent, but we observe random Studio crashes once every 3–4 days, with no clear pattern or specific trigger identified so far.

If we will encounter again will raise service ticket and create a bug thread here in community
