Skip to main content

[WebUI] Wait For Element Not Visible

Description​

Wait until the given web element is not visible within a timeout.

Keyword name: waitForElementNotVisible

Parameters​

ParameterParameter TypeRequiredDescription
toTestObjectYesRepresents a web element.
timeoutintYesSystem will wait at most timeout (seconds) to return result.
flowControlFailureHandlingOptionalSpecify failure handling schema to determine whether the execution should be allowed to continue or stop.

Returns​

Parameter TypeDescription
Boolean
  • true if the element is present and not visible in the given timeout.
  • false if the element is present and visible in the given timeout.

Example​

You want to wait for the Make Appointment button to be not visible in 20 seconds:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

'Open browser and navigate to demo AUT site.'
WebUI.openBrowser(GlobalVariable.G_SiteURL)

'Wait for 'Make Appoint' button NOT visible in 20 seconds'
WebUI.waitForElementNotVisible(findTestObject('Page_CuraHomepage/btn_MakeAppointment'), 20)

'Close browser'
WebUI.closeBrowser()
Was this page helpful?
  • Description
  • Parameters
  • Returns
  • Example