Assert inside of an iframe

I need to check some text is present in a table inside of an iframe (see the selected row in the screenshot- the one containing text “J00”).

The problem is: KS can’t find this element:

(Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/myElement located by 'By.cssSelector: #slucajTrenutni tbody tr:nth-child(1)' not found)

I tried switching to frame and to window index…also delays and wait for element visible, present, clickable…

I am able to click other elements of the iframe but when I try to getText() Katalon just doesn’t see the element. Why is this happening?


Hi Mate,

Try this

WebUI.getAttribute(findTestObject(‘your test object’), ‘value’)

you can also pass into a string and print it if you want to see
the returned value.

hope that helps :slight_smile:

I tried it, doesn’t work.

I always get the “Web element not found” message.

Maybe it has something to do with the table and the way it is rendered?

What locator are you using? xpath? id? name?

or maybe your locator is the problem since you’re getting the “Web element not found” error message

I recommend using xpath as your locator

Any specific reason?
I’m currently using css selector, as you can see in the OP. Is there a reason for using xpath in this particular situation, because it seems pretty random?

Well you can try, since xpath can provide unique nodes to elements.

Tried it, doesn’t work.

I still think it has something to do with the table and the way it is rendered.