since I have updated to the new version of Katalon Studio 8.6.0, all test cases fall, because command waitForElementNotPresent is not working properly. If I run the same test case on Katalon Studio 8.5.0, test case passes successfully.
There is a problem that waitForElementNotPresent is constantly waiting even though the element is no longer displayed on the page. Like I said before - on version 8.5.0 the same test case was fine, so I suppose there is no problem in my test case.
The log says: Unable to find the element located by 'By.xpath: //div[@class='Preloader ‘]’. Please recheck the objects properties to make sure the desired element is located.
(console: 2023-03-20 09:20:39.898 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by 'By.xpath: //div[@class='Preloader ‘]’. Please recheck the objects properties to make sure the desired element is located. )
= but that’s not the function of this command waitForElementNotPresent. This command should not wait if the element is not presented on my page.
Please could you verify that issue?
Thank you very much
Katalon Studio version
Environment (for Web Testing)
The keyword waitForElementNotPresent would wait until the given element to not present (disappear) within the given time in the second unit. This mean that the object need to be appear first then this keyword would help you to wait until that element disappear. For this could you confirm that in the case this keywords is execute the object //div[@class='Preloader ‘] still present? You could use the waitforelementpresent to test the object first to make sure that it still present at the time to test that object.
It’s strange, because until version Katalon Studio 8.5.0 we were used to use this command like this:
We were used to use waitForElementNotPresent in the sense that the command checks to see if the element is on the page and if so then waits for the specified amount of time. If not so, test case continues despite the fact that the element was not displayed before. We use this as a check that if there is any loader on the page, wait until it disappears. It worked like this for over a year.
Even now if i run version 8.5.0 it behaves like we used to, but after version 8.6.0 the behaviour of the this command is changed.
I have read all change log of the the new version 8.6.0 and there is no mention of a change in logic in this command.
I have read the desctiption of this command (here: [WebUI] Wait For Element Not Present | Katalon Docs) and I’m still convinced that it’s a bug, that the command should check if the element is presented and it not so… test case should continue without waiting for the elemenet. There is also example: “You want to wait until ‘Make Appointment’ button is NOT present in 20 seconds.” What I understand is that the command waits until the button disappears and waits a maximum of 20 seconds (but that doesn’t mean it will wait the full 20 seconds if the button disappears earlier)
I also verified the option that the element is first displayed on the screen and then disappears, and despite this the waitForElementNotPresent command displays a timeout.
Here is the source code of waitForElementNotPresent keyword of v8.0.5:
I do not think your sentence is right.
As far as I understand from the source code, the waitForElementNotPresent keyword of v8.0.5 is stateless. It does not remember at all if the HTML elment once was present first and then later disappeared.
You, a paying user, should raise a support request. I suppose that Katalon developers are not aware of this issue. I am afraid that they haven’t tested their product enough. There could be more problems to be found. You should send an alert to them.
I can easily see that v8.6.0 changed its behavior: which type of Exception to expect. v8.0.5 expects NoSuchElementException. v8.6.0 expects WebElementNotFoundExcetion. I don’t know the detail how these 2 exceptions differ. I guess, @petr.brezina was trapped by this change.
Repeatedly applies this instance's input value to the given function until one of the following occurs:
the function returns neither null nor false
the function throws an unignored exception
the timeout expires
the current thread is interrupted
interresting, the until timeout never expire … most probably a TimeoutException is never raised since the keyword only raise WebElementNotFoundException
Thanks for your input. I am also experiencing issues with the ‘wait for element’. I have replaced it for a delay, but it is not very useful. Hopefully there is an alternative or the element’s function can be restored.