Is there any way to use the keyword waitForElementNotVisible() with WebElement?

I need to wait for a WebElement not visible, Is there any way to use the keyword waitForElementNotVisible() with WebElement?

Hello simple,

Please refer to this document of waitForElementNotVisible() keyword for the required parameter when using it.

Let us know if you need help with anything else

Thanks for using Katalon Studio,

@“Liam B” I’ve read the document , but it cannot meet my requirement. The parameter in the document is TestObject, but I want to use WebElement

It doesn’t support WebElement as a parameter for built-in keyword. Please create a Test Object with properties matching that WebElement and use that instead.

@“Vinh Nguyen” the properties of the Webelement are dynamic generated, so I cannot save the webelement as a TestObject in Object Repository.

You can parameterize Test Object based on this guide:

Just pass in the variable you observe it is generated dynamically in runtime and Katalon Studio will use that value in your locators.

@“Vinh Nguyen” thanks for your help, I will try it. BTW, do you know after the Katalon Analytics is released in the future, whether the Katalon Analytics could be installed in my local environment?


You can use this workaround for testing a dynamic WebElement.

Here is the code

import com.kms.katalon.core.testobject.ConditionType as ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import as Mobile
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import internal.GlobalVariable as GlobalVariable
TestObject to = new TestObject()
to.addProperty('xpath', ConditionType.EQUALS, dynamicValue, true)
WebUI.waitForElementVisible(to, 10)

@“Liam B” Thanks very much, it works for me.