Forum Discussion

Nikhil1249's avatar
Nikhil1249
New Contributor
2 years ago

How to handle iframes in the keyword test ?

I am unable to capture some of the objects on my website which is under the frame. 

I have followed some steps and still unable to capture the objects. 

Help me out with any solutions. 

Here is the steps I have followed but didn't work:

--disable-web-security
--user-data-dir="C:\Users\SHAR247\AppData\Local\Google\Chrome\User Data\Default"
--disable-site-isolation-trials

 

Here is the error message I am getting when I am trying to check the xpath with the seltors hub 

Element inside cross-origin iframe. Copy Selectors by right click on element or open iframe src url in new tab.

 

Attaching the image of the frame structure for my website and I want to capture the object of the iframe. Attached the IMage. PFA

 

1 Reply

  • Kitt's avatar
    Kitt
    Regular Contributor

    [TestComplete reference] Sounds like the iframe is treated as a separate window/page and depending on your approach, TC may not know that it needs to set it's focus on another window to find the objects within. Consider using NameMapping to find the object [Community reference] - You can also use the object spy tool in TC to see how TestComplete is finding and naming these objects.