Open Bug 1301073 Opened 4 years ago Updated 17 days ago

WebDriver:SwitchToWindow should not allow switching by window name


(Testing :: geckodriver, defect, P3)

Version 3


(Not tracked)


(Reporter: standard8, Unassigned)


(Blocks 2 open bugs)


(Keywords: pi-marionette-spec)


(1 file)

The w3c specification for WebDriver [1] doesn't allow for passing a window "name" as a handle to switchToWindow - only an id.

Currently the code allows for a "name" or an "id", however the implementation of "name" is wrong as it uses the window name of the actual window rather than the of the content process within a tab (xref bug 1283941).

Seeing as it doesn't need to be supported, we should just remove the name option to save confusion.

Blocks: webdriver
Summary: switchToWindow shouldn't take a handle as a name. → switchToWindow shouldn't take a handle as a name
OS: Unspecified → All
Hardware: Unspecified → All
Summary: switchToWindow shouldn't take a handle as a name → Switch To Window should not allow switching by window name
Priority: -- → P2
Summary: Switch To Window should not allow switching by window name → WebDriver:SwitchToWindow should not allow switching by window name

The necessary code change this bug covers are:


Note that for geckodriver the handle argument has been added via bug 1519053 to geckodriver 0.25.0. So if we make the change to driver.js now, it would mean that everything before 0.25.0 (which only supports name) will not work with Firefox 71 and later anymore. But geckodriver 0.25.0 and later which support both name and handle will not require us to bump the minimum supported version of Firefox.

Another solution would be to add the support for handle in driver.js first, and get this released. And then we follow-up later (when we have the time for) with the name removal.

Given the actual problems with 0.25.0 with MSVCRT we may want to do the interim solution and give people more time in case they want/have to stay with geckodriver 0.24.0 for now?

Personally I would prefer the latter option. Maja and Andreas, what do you think?

Flags: needinfo?(mjzffr)
Flags: needinfo?(ato)

If switching by name breaks backwards compatibility I would prefer
not removing this feature.

Flags: needinfo?(ato)

Ok, so in that case I will file a bug for Marionette which simply adds using the handle if specified for now. Then after a couple of Firefox releases (maybe after the next ESR) we can work on this bug, and get it removed.

Flags: needinfo?(mjzffr)

As filed this is more a geckodriver related bug. So I'm going to move it into the correct component.

Note that with bug 1588424 fixed we no longer accept name as argument for WebDriver:SwitchToWindow in Marionette. The remaining patch to do will be to finally remove passing in the name by geckodriver:

By doing that it would move the minimal supported version of Firefox to 67.0 for the geckodriver release including this change. We can easily do that for the 0.28 release.

Blocks: 1649094
Component: Marionette → geckodriver

Turns out that we actually didn't swap the Marionette code from name to handle earlier on, and my fix on bug 1588424 made the hard switch. It means that the minimum version of Firefox as supported will not be 67.0 but 80.0.

That means that we will still have to wait a while (at least until 78.0esr is no longer supported) until we can get it removed in geckodriver. Nevertheless I will attach a WIP patch.

Starting with geckodriver 0.25.0 the "handle" argument (available
since Firefox 67) for the "WebDriver:SwitchToWindow" call to
Marionette has been added. Since then the "name" argument in
Marionette has been removed (Firefox 80).

That means sending "name" is no longer necessary, and can be
removed. By doing that the minimum supported Firefox version
will be bumped to Firefox 80.0.

Assignee: nobody → hskupin
Assignee: hskupin → nobody
Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.