Re: [Bug 28131] New: Currently the spec defines switching to window by handle only, does it need by name too?

If memory serves part of the reason for not going with name was if you have
something that was not unique then you would have to cycle through the
windows. Instead of people getting lucky when there is only 1 name and it
works and then suddenly stops working it was thought to remove the by name.
It may feel longer but at least the right API use is suggested to the user.

As for switchToFrame, the reason for removing support for name/id and only
supporting index and webelement was to try make people write more
deterministic code since we fall into the same issue as the conflation of
getElementAttribute where the order of how things are found.

David

On 5 March 2015 at 16:34, James Graham <james@hoppipolla.co.uk> wrote:

> On 05/03/15 16:25, Jason Leyba wrote:
>
> > To the point at hand, yes there is a balancing act. You seem to be
> > arguing it doesn't add much complexity, so why not support it. I'm
> > arguing that the added convenience doesn't justify increasing the
> > surface area or complexity of what implementors should be required to
> > support.
>
> No, I'm arguing that — to the extent that switching windows is a useful
> function at all — switching based on webdriver handle is almost useless
> and switching based on name is very useful. So either every end user has
> to implement their own switch-by-name logic, or every client does. Those
> options are terrible, and very bad respectively since it's reasonably
> easy to get wrong (e.g. not considering that window handles aren't
> necessarily ordered, not considering the possibility of windows getting
> closed between calls, etc.). On the other hand I haven't heard anyone
> argue that this is actually hard for remote ends to support. Therefore
> the priority of constituencies [1] strongly argues for putting this in
> remote ends.
>
> [1]
> http://www.w3.org/TR/html-design-principles/#priority-of-constituencies
> (in this case "users" are WebDriver end users, "authors" are "local end
> implementors" and "implementors" are "remote end implementors").
>
>

Received on Monday, 9 March 2015 15:00:29 UTC