Open Bug 1280517 Opened 4 years ago Updated 2 years ago

opening additional window/tab switches OS focus


(Testing :: Marionette, defect, P3)

49 Branch


(Not tracked)


(Reporter: titus.fortner, Unassigned)


User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36

Steps to reproduce:

geckodriver 0.8, FF Nightly (49)

Navigate to a page that has 2 links that open new windows
Click the first link and the new window opens in a tab as expected (and while the driver is correctly pointing to the first window, the OS has switched to make the  new window the visible window)
Click the second link (shows as successful, no errors)

Actual results:


Expected results:

A third window should have opened
Do you have a testcase? Do you consider this to be a bug in Selenium?
The link I posted above is the test case from the Selenium Ruby Test Suite.

It is not a Selenium bug. Selenium sends the correct calls to geckodriver, and geckodriver is sending the correct responses back. Since nothing is happening on the browser, though, it has to be an issue between geckodriver and marionette.

Marionette is currently the only selenium implementation that switches OS focus to the newly opened window, and I can only guess that this is what is causing an issue with clicking on links in the original window. That being said, the w3c spec does say "commands are unaffected by whether the operating system window has focus or not." So I could just be noticing a discrepancy with other implementations that does not matter.
The Ruby spec for this is passing now.
Component: General → geckodriver
Hm, maybe open in background tab should be the default? Not sure if we can prevent opening a new window in foreground, which would cause the same behavior.
Component: geckodriver → Marionette
Ever confirmed: true
Summary: opening second window switches OS focus → opening additional window/tab switches OS focus
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.