Re: Spec Feedback - IFRAMES

Hi,

WebDriver has the concept of the "current context". This is normally the
"default content", which is essentially the top-level DOM. Operations are
typically assumed to apply only that context. For example, although a
window may contain many nested frames, "find element" will only find those
elements that match the criteria in the DOM of the current context.

Sections 7.2 and 7.3 attempt to describe how to switch that context into
either other windows or sub-DOMs. Put another way, webdriver can find and
interact with elements in DOMs other than the top-level DOM provided the
user has first switched to that context.

Does that help clarify things?

Simon


On Tue, Oct 29, 2013 at 6:08 PM, John Jansen <John.Jansen@microsoft.com>wrote:

> A question has arose about how WebDriver should treat subDOMs such as
> those created by IFrames.
>
> It is unclear if WebDriver should be able to find and interact directly
> with elements within these frames or if we only have visibility to the top
> level DOM
>
> Some wording in the spec seems to indicate the latter:
>
> 6.1 Defining a "window" and "frame" [1]
>
> "Within this specification, a window equates to [HTML5]'s top level
> browsing context."
>
> 7.1 Default Content [2]
>
> "WebDriver's default content is [HTML5]'s top level browsing context for
> the window that is currently receiving WebDriver commands."
>
> 9.3.3 Element ID [3]
>
> "In the case of finding a single WebElement, this must be functionally
> identical to a call to 'document.getElementById()'."
>
> document.getElementId() does not return elements within IFrames
>
>
> [1]
> https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html#defining-window-and-frame
> [2]
> https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html#default-content-1
> [3]
> https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html#element-id
>
>
>
>

Received on Thursday, 31 October 2013 18:51:15 UTC