[WebUI] Verify Element Not Present

This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/webui-verify-element-not-present.html

I use following codes to loop for wait for element not present, but the wait time setting does not work:

for(int i=0;i<60;i++) {
if(WebUI.verifyElementNotPresent(findTestObject(‘common/okta/splash_animation’), 3, FailureHandling.OPTIONAL)) {
WebUI.comment(“Loading Splash Animation…Done!”)
}else {
WebUI.comment(“Loading Splash Animation…”+i)

It’s alway wait there until the element not present, the timeout setting 3 does not work. Any idea?

An element can be Present without being Visible.

You should right click on the page and select, “View Page Source”, and check if the element for the splash_animation is actually present in the code. You might want to change the statement to “NotVisible” instead.