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

**URL:** <https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010>\
**Category:** Miscellaneous\
**Created:** [October 21, 2017, 12:53pm UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010 "2017-10-21T12:53:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Girard](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matthew\_Girard](https://forum.katalon.com/u/Matthew_Girard)\
**Post date:** [October 21, 2017, 12:53pm UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010/1 "2017-10-21T12:53:02Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Matthew\_Girard](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matthew\_Girard](https://forum.katalon.com/u/Matthew_Girard)\
**Post date:** [May 23, 2017, 9:52pm UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010/2 "2017-05-23T21:52:55Z")

</div>

That would be useful!

---

<div class="post-metadata">

**Author:** ![Hari\_Charan](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Hari\_Charan](https://forum.katalon.com/u/Hari_Charan)\
**Post date:** [May 23, 2017, 5:18am UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010/3 "2017-05-23T05:18:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matthew\_Girard](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matthew\_Girard](https://forum.katalon.com/u/Matthew_Girard)\
**Post date:** [May 22, 2017, 6:04pm UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010/4 "2017-05-22T18:04:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [May 20, 2017, 9:38am UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010/5 "2017-05-20T09:38:00Z")

</div>

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()`  
`}`

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:25am UTC](https://forum.katalon.com/t/any-quick-way-to-click-offset-of-an-element/8010/6 "2022-08-08T07:25:04Z")

</div>


