waitForElementPresent doesn't seem to be waiting any more

Operating System

Windows server 2019 64bit (remote azure machine)

Katalon Studio version

e.g. version 8.6.0

Environment (for Web Testing)

  • Edge Chromium 111

Steps to reproduce

I’m using Katalon Runtime Engine to run tests remotely using Azure.

I recently upgraded from 8.4.1 to 8.6.0 and multiple tests started failing on the step waitForElementPresent. I did not change anything about the test itself, and our environment did not change - the only change was the upgraded version of Katalon.

On viewing the video, Katalon is clearly no longer waiting, and in the log there is no waiting before failure - in the lines below from the log you can see there is no wait, and Katalon now fails immediately when it cannot find the object (redacted for privacy). I had to add delays to get the test to pass since it takes a couple seconds for this part of the page to load, but this is not ideal compared to using waitForElementPresent.

04/05/2023 02:16:52 +09:00 - [MESSAGE][PASSED] - Wait for page load successfully
04/05/2023 02:16:52 +09:00 - [TEST_STEP][NOT_RUN] - waitForElementPresent(findTestObject(“abc123”), 10): Object ‘abc123’ is not present after 10 second(s)

1 Like

I guess you have the “Self-healing tests” feature enabled.

The waitForElementPresent keyword of v8.6.0 changed its behavior in the case where the Self-healing test is enabled.

Please try disabling the “Self-healing tests”. Possibly it will let you work around the problem.

I can tell you the reason why.

I happened to develop a tool that compares the source code of Katalon Studio v8.4.1 and v8.6.0. See

In the attached zip you would find a file diff/8.4.1_8.6.0/com/kms/katalon/core/webui/common/WebUiCommonHelper.java, which has the content like this:

--- /Users/kazurayam/katalon-workspace/KS_versions_source_diff/build/source/8.4.1/com/kms/katalon/core/webui/common/WebUiCommonHelper.java
+++ /Users/kazurayam/katalon-workspace/KS_versions_source_diff/build/source/8.6.0/com/kms/katalon/core/webui/common/WebUiCommonHelper.java
@@ -733,1 +733,1 @@
-            List<WebElement> foundElements = findElementsByDefault(testObject, timeout);
+            List<WebElement> foundElements = findElementsByDefault(testObject, 0);
@@ -900,0 +900,1 @@
+            testObject.setSelectorMethod(SelectorMethod.CSS);
@@ -961,0 +962,5 @@
+                } else {
+                    if (isSwitchToParentFrame) {
+                        switchToDefaultContent();
+                    }
+                    break;

This unified-diff text tells us that the com/kms/katalon/core/webui/common/WebUiCommonHelper.java file was changed. It is different at the line #733.

Lets find the full source of WebUiCommonHelper.java and see what this change means:

As far as I read the source, the findElementsWithSelfHealing(TestObject testObject, int timeout) method of the WebUiCommonHelper class of the v8.6.0 waits for the timeout of zero seconds at the line#733, which explains the incident that @jeanie.conner reported

Why timeout = 0? … Is it a careless mistake? or any good reason? I don’t know.

@vu.tran @Shin


@uyen.do @xuan.tran for your visibility too

1 Like

I checked, and I do not have the self healing option selected, and I am not able to even select it because I don’t have Katalon Enterprise. I am running the tests using Katalon Runtime Engine - however, in the logs, I do see:

04/05/2023 01:34:46 +09:00 - [MESSAGE][WARNING] - [SELF-HEALING] Failed to find element with id 'abc123'. Try using Self-healing.
04/05/2023 01:34:46 +09:00 - [MESSAGE][WARNING] - [SELF-HEALING] Cannot find elements when the XPath is null.
04/05/2023 01:34:46 +09:00 - [MESSAGE][WARNING] - [SELF-HEALING] Cannot find elements when the selector is null

I’m not sure why self-healing is being used here when I cannot even set the option.

Hi all,

Just to update that our new release of Katalon Studio 8.6.5 has solved this problem. Please find more details here

1 Like

Well, I’m on Katalon Studio version 8.6.6 and still don’t understand why some tests fail without waiting for the wanted timeout…

09-04-2023 04:56:37 PM if (verifyElementNotPresent(findTestObject("Coverage/Panoramas/panorama-line"), timeout, STOP_ON_FAILURE))

Elapsed time: 0,930s

Web element with id: 'Object Repository/Coverage/Panoramas/panorama-line' located by 'By.xpath: //div[@data-qa-itemtype='coveragePage']//div[@data-qa-id='panorama_models']//div[@data-qa-itemtype='listItem']' is not present after '10' second(s)
1 Like

Web element with id: '...' is not present after '10' second(s)

This message impiles that the verifyElementNotPresent keyword did wait for wanted timeout (10 seconds). But you wrote :

You meant something opposite. Are you sure? If you are sure, you should prove it with some evidence.

As you must be aware of, the WebUI.verifyElementNotPresent keyword once had a problem at v8.6.0 but was fixed at v8.6.5.

I developed a project to check it. I reported that the waitForElementNotPresent has been really fixed.

I changed the verification project a bit, as follows:

		//boolean kwReturn = WebUI.waitForElementNotPresent(tObj, timeout)
		boolean kwReturn = WebUI.verifyElementNotPresent(tObj, timeout)

and checked how the verifyElementNotPresent keyword at v8.6.6 works. I found that the verifyElementNotPresent keyword at v8.6.6 works fine.

So I believe that the verifyElementNotPresent keyword is not guilty for @qa113’s current problem.

1 Like

Paying attention to my test, I can assure you that the step doesn’t last 10 seconds, but exactly the time shown here :

Elapsed time: 0,930s

I can not reproduce your case on my side. I would quit.