Frames
Think of an IFrame as a page of HTML inside of another page of HTML. They will look
like this, with a src
attribute that includes the inserted html:
By default the browser driver only looks for elements in the top level browsing context. If an element exists inside of an iframe, it must be told to look there. Browser Context switching is handled for you in Watir. The only requirement is that when defining an element, it must include the full address to that element including a reference to any iframes it is nested inside. Recognize that it is possilbe for iframes to be nested inside of iframes.
As of Watir 6.9, if an element can not be located, Watir will check to see if the page has iframes and will advise the user to check to see if the element is inside of an IFrame.