In the Katalon User forum, there was a post “Katalon Studio 8.6.0 - waitForElementNotPresent - bug - timeout”. The original post reported that, at v8.6.0, WebUI.waitForElementPresent keyword failed to work. Later, @vu.tran reported that, at v8.6.5, the bug was fixed. However, @qa113 wrote that the bug still remains in v8.6.5.
The bug of waitForElementNotPresent keyword — is it fixed at v8.6.5 or not?
I have developed a Katalon Studio project kazurayam/waitForElementNotPresentWorksOrNot. With it, I examined how WebUI.waitForElementNotPresent
keyword works in v8.4.1, v8.6.0 and v8.6.5.
You can download the zip of this project from the Releases page, unzip it, open it with your local Katalon Studio.
You can see our Application Under Test at
The page shows a Countdown clock. The clock has a countdown distance of 10 seconds as default.
Internally the HTML contains an P element with id=”clock” as this:
<p id="clock">0d 0h 0m 8s</p>
When the countdown clock reaches zero, then the clock will disappear. A message “Gone!” comes up.
Internally, the <p id="clock">0d 0h 0m Xs</p>
element will be removed (becomes not present) when the clock reached zero.
Please read the source codes for detail.
You can execute “Test Suites/TS1” which will execute “Test Cases/TC1_d10_t7” and “Test Cases/TC2_d10_t13” in this sequence. The TS1
is enabled to take movies in MOV format. I converted the MOV movies to MP4, and posted them to YouTube.
I developed a set of test scripts in Katalon Studio which employs the WebUI.waitForElementNotPresent(TestObject, int timeout)
keyword.
The scripts use 2 terms with special meaning. So let me define them.
distance — The countdown clock starts with the given distance (default=10), goes down by 1 second until it reaches 0.
timeout — The WebUI.waitForElementNotPresent
keyword requires an integer as 2nd argument “timeout”.
I have developed 2 cases of verification.
Test Case 1 : The distance is 10 seconds, timeout is 7 seconds. The target HTML element “clock” is there yet in the page when the timeout expires. The clock will remain in the page view. In this case, the keyword should stop immediately after the timeout. The keyword should return false
to the caller script.
Test Case 2 : The distance is 10 seconds, timeout is 13 seconds. The target HTML element “clock” will disappear before the timeout expires. The clock will fade and a message “GONE” will comes up in the page view. In this case, the keyword should stop immediately after the timeout. The keyword should return true
to the caller script.
In this case, the WebUI.waitForElementNotPresent
keyword worked just as expected in v8.4.1.
see the Movie (v8.4.1 TC2_d10_t7)
The keyword worked the same in v8.6.0 and v8.6.5 as well.
This case is interesting. The WebUI.waitForElementNotPresent
worked as expected in v8.4.1. But it started to behave strange in v8.6.0. And in v8.6.5, the problem was fixed.
It worked OK in v8.4.1.
see the Movie (v8.4.1 TC2_d10_t13)
The WebUI.waitForElementNotPresent
behaves strange in v8.6.0. When the AUT page is opened, it starts displaying a countdown clock. After 10 seconds, the countdown expires; the clock disappears; a message “Gone” comes up in turn. The keyword would detect the clock is no longer there. We expect the keyword to return immediately when the clock disappears. However, the keyword in v8.6.0 doesn’t stop immediately. The keyword blocked for more seconds. This is the problem which @petr.brezina pointed out.
See the Movie (v8.6.0 TC2_d10_t13)
The WebUI.waitForElementNotPresent
keyword in v8.6.5 behaves as expected.
Based on the findings in the examination, I would conclude that the original problem raised by @petr.brezina was really fixed at v8.6.5.