# How to enter value in iframe

**URL:** <https://forum.katalon.com/t/how-to-enter-value-in-iframe/39383>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 3, 2020, 4:02pm UTC](https://forum.katalon.com/t/how-to-enter-value-in-iframe/39383 "2020-02-03T16:02:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalks.r](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lalks.r](https://forum.katalon.com/u/lalks.r)\
**Post date:** [February 3, 2020, 4:02pm UTC](https://forum.katalon.com/t/how-to-enter-value-in-iframe/39383/1 "2020-02-03T16:02:13Z")

</div>

I’m pretty new to Katalon Studio and I’m trying enter value in the text field but no hope.

do you have any solution to get/define/get through to the specific iFrame?

Please see the details below.

**Text box and Inspect Element**

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/2/23fe8df0a67a98ebf1ee7d61561c52964b38ccac.png)

**Xpath captured while recording:**

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/a/a1dc3ca3386564021b1ab03b07d37851cfcbfffe.png)

**Object properties captured while recording:**

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/4/410ad0de2e8236bcf8ad21445dc9d3ca9df9b7bf.png)

---

<div class="post-metadata">

**Author:** ![Timo\_Kuisma1](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/timo_kuisma1/32/16103_2.png) [@Timo\_Kuisma1](https://forum.katalon.com/u/Timo_Kuisma1)\
**Post date:** [February 3, 2020, 4:49pm UTC](https://forum.katalon.com/t/how-to-enter-value-in-iframe/39383/2 "2020-02-03T16:49:57Z")

</div>

hi,

try to use css selector as locator

> <https://stackoverflow.com/questions/4500572/how-can-i-get-the-css-selector-in-chrome>

---

<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:** [February 3, 2020, 5:00pm UTC](https://forum.katalon.com/t/how-to-enter-value-in-iframe/39383/3 "2020-02-03T17:00:37Z")

</div>

@lalks.r

There are a few ways to tackle this so relax in the knowledge _something_ will work for you. I’m with Timo, I’d use CSS selectors for this (that’s what browsers do natively, so why not?)

First, take a read of this article I posted a while back. There’s a section devoted to dealing with iframes. Get that knowledge under your belt and then post back if you still have questions/problems.

[http://forum.katalon.com/t/how-to-groovy-javascript-css-using-css-selectors-in-javascript-in-groovy-in-test-cases/34488](http://forum.katalon.com/t/how-to-groovy-javascript-css-using-css-selectors-in-javascript-in-groovy-in-test-cases/34488)

And just for completeness, you might also benefit from a related article: **[DevTools](http://forum.katalon.com/t/how-to-the-browser-developer-tools-f12-devtools/34329/)**

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [February 3, 2020, 6:32pm UTC](https://forum.katalon.com/t/how-to-enter-value-in-iframe/39383/4 "2020-02-03T18:32:37Z")

</div>

The below assumes that your page contains one (and only one) iframe, and that it is not nested inside another iframe:

1.) In your test object, you just need one row, Name = “xpath”, Condition = “equals”, Value = “//iframe”, Detect object by? = checked  
2.) Switch to the frame with the below code:

`WebUI.switchToFrame(findTestObject("path/to/object"), 30)`

3.) Use whatever code to set the field.

Again, this assumes you are working with only 1 iframe. If there are multiple frames, or nested frames, you will need a more specific xpath to find the right one.
