Unable to click in object associated with iframe

I’m guessing you’ve defined the parent iframe in the TestObject itself?:

image

If so, I would recommend that you don’t use this functionality, and that you handle switching between frames yourself in the test code:

WebUI.switchToFrame(findTestObject('path/to/iframe/object'), 30);

// Do a bunch of steps that work with elements within that frame...

WebUI.switchToDefaultContent();

My guess as to what’s happening is that you are successfully switching to the expected iframe in the first step, and then Katalon is trying to switch to that same iframe AGAIN, but can’t find it, either because

1.) You are already in that iframe’s context (i.e. there’s not another iframe at //iframe[@name='EMBPAGE1'] that is a child of the iframe you are already in).

2.) The page has reloaded, and your elements are stale.

This is why I don’t use the “Parent iframe” property in my TestObjects. It just confuses things in my opinion.

6 Likes