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)
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.
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.
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)