# Cannot click on iframe objects

**URL:** <https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [March 11, 2020, 2:00pm UTC](https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962 "2020-03-11T14:00:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Support1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Support1](https://forum.katalon.com/u/Support1)\
**Post date:** [March 11, 2020, 2:00pm UTC](https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962/1 "2020-03-11T14:00:52Z")

</div>

Hello,

I am facing an issue where the auto test cannot click any object within an iframe.

I tried using the spy object tool and the recording tool and both were unable to find and click any object within the iframe. I tried switching between the XPath and the Attributes, tried copying the xpath directly, still not working.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [March 11, 2020, 2:03pm UTC](https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962/2 "2020-03-11T14:03:21Z")

</div>

Try searching the forum.

---

<div class="post-metadata">

**Author:** ![Support1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Support1](https://forum.katalon.com/u/Support1)\
**Post date:** [March 11, 2020, 2:07pm UTC](https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962/3 "2020-03-11T14:07:02Z")

</div>

I tried to find an answer on previous topics, but sadly none of the solutions helped.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [March 11, 2020, 2:13pm UTC](https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962/4 "2020-03-11T14:13:05Z")

</div>

Show me some HTML incorporating the `iframe` element and the element within you are trying to target.

---

<div class="post-metadata">

**Author:** ![Ilkka\_Kovalainen](https://avatars.discourse-cdn.com/v4/letter/i/ac91a4/32.png) [@Ilkka\_Kovalainen](https://forum.katalon.com/u/Ilkka_Kovalainen)\
**Post date:** [March 13, 2020, 5:52am UTC](https://forum.katalon.com/t/cannot-click-on-iframe-objects/40962/5 "2020-03-13T05:52:37Z")

</div>

First switch to iframe  
`WebUI.switchToFrame(findTestObject('path/to/iframe/object'), 5)`  
do what you need to do  
`WebUI.click(findTestObject('path/to/click/object'))`  
and switch to back to default content  
`WebUI.switchToDefaultContent()`

or tell you click object where its parent iframe is.
