So in helping another user troubleshoot a Selenium/selector issue, I believe I ran in to a larger issue for which I'm wondering if there is any solution.
Basically, I have come upon (i)frame hell. Sorry to include a screenshot of the dev console, but I couldn't find a good way to copy it over.
So, as you can see if you will kindly click the above image, the HTML for this page features frames inside framesets inside frames inside....
I was able to identify the first level of frames, but of course the element we wanted to locate was in the middle of all these frames.
What I found is that using xpath
, cssSelector
, ID
, Name
, any type of locator, I could never find any element past and including anything nested beneath a #document
element. I've read on quite a few sites that this is either very difficult or impossible to do, but I never came across a solution that would work for this page.
Is this possible, and if so how can one get past these #document
elements?
P.S. let me know if there is an easy way to copy the actual text as pictured from the console and I will do so for the whole page.
This is not a duplicate of that question because this is regarding multiple nested Frames with #document
elements that Selenium apparently cannot get past. All examples provided only have one (i)Frame. I know how to switch to iFrame, but it seems is impossible to switch to an element or frame inside nested Frames that contain #document
using Selenium alone; jQuery is a solution to this problem so I accepted the below answer.
I really don't care if it erroneously gets closed as a duplicate since I have gotten a solution but I am 100% certain it is a separate issue from simply switching to an iFrame.