The element is not clickable

@Curtis_BRODERICK

Yea, the WebUI API can be troublesome at times (or I’m just using it incorrectly). Since the approach in my original comment seemed to work for you, we can just use that. It’s a bit more verbose, but not too bad. Go ahead and replace your Util class with this:

package util

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

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

public class Util {

	public static void jsClick(final TestObject testObject) {
		WebElement element = WebUiCommonHelper.findWebElement(testObject, 30);
		WebDriver driver = DriverFactory.getWebDriver();
		JavascriptExecutor jsExecutor = (JavascriptExecutor)driver;
		jsExecutor.executeScript("arguments[0].click();", element);
	}
}

I ran this on my side as well to be sure, should work fine :slight_smile: I’ve updated the demo I gave above to match this.

Side note: A “method” in Java is analogous to a “function” in C/JavaScript/etc. It’s just a set of code you can call to do some chunk of work for you.

2 Likes