Object Spy: unable to identify iFrame nested menu items - blocks automation

When I use Object Spy on a page it returns the following:
id(“katalon-spy_elementInfoDiv”)

This is for multiple elements / menu items on a sub-menu that is built on a page with nested iFrames.

<Yes, I know nested iFrames for menus is a bad design - I didn’t build it>

It shows this message rather than returning the actual object identifier to be used in building new objects.

To further limit things when I click on the menu item that shows id(“katalon-spy_elementInfoDiv”) the web page (menu I clicked) does not actually open the relevant page; nothing happens at all. This prevents me from going into that page to capture objects for further automation.

Below is the script.

Note: already we were struggling to navigate throguh the nested iFrames so used Selenium native command.

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.By as By

import org.openqa.selenium.WebDriver as WebDriver

import org.openqa.selenium.WebElement as WebElement

import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

import org.openqa.selenium.Keys as Keys

import java.awt.Robot as Robot

import java.awt.event.KeyEvent as KeyEvent

import java.util.Date as Date

WebUI.openBrowser(‘’)

WebDriver driver = DriverFactory.getWebDriver()

WebUI.navigateToUrl(‘https://URL_to_open’)

WebUI.waitForPageLoad(1)

WebUI.setViewPortSize(1280, 1024)

WebUI.delay(1)

WebUI.setText(findTestObject(‘Page_Login Page/input_loginUser Name’), ‘blank’)

WebUI.setText(findTestObject(‘Page_Login Page/input_loginPassword’), ‘blank’)

WebUI.setText(findTestObject(‘Page_Login Page/input_loginStore ID’), ‘blank’)

WebUI.waitForPageLoad(1)

WebUI.delay(1)

WebUI.click(findTestObject(‘Page_Login Page/input_login’))

WebUI.waitForPageLoad(1)

WebUI.delay(1)

WebUI.switchToDefaultContent()

WebUI.switchToFrame(findTestObject(‘Page_QFUND/frame_topFrame’), 10)

WebUI.click(findTestObject(‘Page_QFUND/img_customerMgmt’))

WebUI.waitForPageLoad(1)

WebUI.delay(1)

WebUI.comment(‘’)

WebUI.switchToDefaultContent()

//WebUI.switchToFrame(findTestObject(‘Page_QFUND/frame_mainFrame’), 10)

‘Selenium method to switch frames - Katalon struggled with nested frames’

driver.switchTo().frame(‘mainFrame’).switchTo().frame(‘topFrame’)

//WebUI.click(findTestObject(‘Page_QFUND/frame_mainFrame’))

//WebUI.switchToFrame(findTestObject(‘Page_QFUND/frame_topFrame - submenu’), 10)

WebUI.click(findTestObject(‘Page_QFUND/CustomerSummary’))

WebUI.waitForPageLoad(1)

1 Like

Additional comment: this was using Chrome browser (latest version) plus Katalon 5.6.0.

Also - I tried to get around this issue by using the Recorder to capture the sequence then I was planning to strip off the unnecessary parts in order to build a complete script - but even the Recorder cannot capture successfully clicking on the menu.