Iframe objects not being found

There is an iframe on the website that I am testing with lots of elements inside of it. I use the Spy Web to locate the elements and the iframe and send them to the object repository. Whenever I run the test cases though it successfully switches to the iframe but can not locate any one specific element (element not found error) like the Spy Web did and I verified that the Spy Web was finding only one element. When I switch which properties to detect the object by in the spy web to detect multiple objects and then do the same in the test case it switches the error to element not visible.

Any idea why I can find multiple elements but can’t find a specific one in the test cases although I can find it in the Spy Web.

Is your Iframe dynamic? Are ID-s/attributes of your Iframe tag changing every time you switch to it?

Try turning off the parent object for elements you caught with the Spy Web:


The Id’s are changing each time across the whole web page but I am able to locate other elements outside the iframe through other means like classname, tags, and Text. Also I have tried using the the Parent Iframe and without using the parent Iframe and neither way is working using the switchTo case respectively when switching it on/off.

I have also verified that the switching to the iframe is working as I can not locate any elements outside of the iframe that I can normally locate.

Hi, are there any updates on this matter? I have faced the same issue with locating elements in iFrame. The thing is it is working in Firefox but not in Chrome. The mentioned iFrame loads map with some tools (images) like drawing, erase or measurement tools but they are never found. E.g. drawing tool has xpath like:
//div[@id=“tool_draw”]/img[1][@src = ‘images/White_Draw.png’][count(. | //img[@ref_element = ‘Object Repository/Create_Ticket/Page_Locate request creation/iFrame_Map/iframe_comcon’]) = count(//img[@ref_element = ‘Object Repository/Create_Ticket/Page_Locate request creation/iFrame_Map/iframe_comcon’])].

Also tried win no parent element using methods to switch to iframe and back, but no result.
I wonder if any other work around exists for this?