Switch to Frame does not work

“Switch to Frame” does not switch to the iFrame.
I have verified that iFrame element exists but it failed to Switch to the Frame.
I have a time of “35” sec.

I get following error:
switchToFrame(findTestObject(“Home Page/Reports/Administrative/PVS MAP Assignment/iFrame_PVSMAP Assignment Report iFrame”), 35)

Elapsed time: 0.104s

That’s the test step. Can you please post the error?

It says Switch to frame time elapsed. It doesn’t pass/fail the step. It fails on the next step where it has to verify element exists. This element exists on the frame but Katalon doesn’t recognize it.

It’s the next line that seems to be failing.

Please post the relevant lines from the console log.

And read this:

I put a wait for element to be present for 35 sec, it fails here after switching / not switching to iFrame.
This element is being recognized when i do a object spy and identify it. It is not being recognized in the script.
Here is the log:
2021-11-08 10:56:46.952 INFO c.k.k.c.webui.common.WebUiCommonHelper - Unable to find the element located by ‘By.xpath: //div[@id=‘tax-unit-grid-root’]/iframe[@class=‘pts-report-screen-layout’]’. Please recheck the objects properties to make sure the desired element is located.
2021-11-08 10:56:47.346 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to wait for object ‘Object Repository/Home Page/Reports/Administrative/PVS MAP Assignment/label_PVS YR’ to be present (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to wait for object ‘Object Repository/Home Page/Reports/Administrative/PVS MAP Assignment/label_PVS YR’ to be present
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)

If I understand what you’re doing correctly…

  1. You’re switching to the iframe which means from that point on, all selectors will be based on the document inside the iframe.

  2. You’re using an XPATH selector which includes a reference to the iframe.

Doing both seems to make no sense. Try adjusting the XPATH expression to work from the root of the iframe as though it were the only document.