Any quick way to click ‘offset’ of an element?

Hey,

I’m looking for a way to click within a canvas without knowing the internals of the canvas, thereby clicking ‘offsets’ within the canvas. Any quick way to do this in Katalon?

Thanks!

That would be useful!

Why can’t we have this as a buit-in keyword? I assume this works for all the applications

Great, that set me in the right direction. Thanks!

You can create the following keyword and use it in your test case by passing your canvas as a test object

import org.openqa.selenium.interactions.Actions
import com.kms.katalon.core.webui.driver.DriverFactory

@Keyword
def clickAtOffset(TestObject to,int Xoffset,int Yoffset)
{
ele = WebUiCommonHelper.findWebElement(to, 30)
WebDriver driver = DriverFactory.getWebDriver()
Actions build = new Actions(driver)
build.moveToElement(ele, Xoffset, Yoffset).click().build().perform()
}