The element is not clickable

Have you considered using JavaScript to click on elements instead of the WebUI API (which uses Selenium commands in the background)?

We have apps that have overlays, things rendering on top of each other periodically, modal dialogs, etc, and often you’ll get much more consistent and desirable behavior using Javascript, jQuery, etc, to do the majority of the work:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement

import com.kms.katalon.core.webui.common.WebUiCommonHelper
import com.kms.katalon.core.webui.driver.DriverFactory

// Turn your TestObject into a WebElement...
WebElement element = WebUiCommonHelper.findWebElement(findTestObject("my/test/object"), 30);

// Get the current driver from Katalon and convert to a JavascriptExecutor...
WebDriver driver = DriverFactory.getWebDriver();
JavascriptExecutor jsExecutor = (JavascriptExecutor)driver;

// Click your WebElement using JavaScript...
jsExecutor.executeScript("arguments[0].click();", element);

If you find that this kind of thing works for you, consider creating a Custom Keyword that acts as a utility method, then you can pass any objects that you want to click. Also, this approach isn’t limited to clicking on elements, we also use similar methods to set dropdowns, send keys to text fields, etc.

Hope this helps!

1 Like