Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Firefox only supports windows not tabs #3380

Closed
lukeis opened this issue Mar 3, 2016 · 3 comments
Closed

Firefox only supports windows not tabs #3380

lukeis opened this issue Mar 3, 2016 · 3 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 3380


Selenium version: 2.19.1-py2.6
OS: W7 64
Browser: Firefox
Browser version: 10.0.1

Hi

As in the summary, it seems that the selenium python bindings  do not report a handle
for every tab opened, but only for every window.
As far as i know, this problem does not exist in ruby bindings and java bindings.

the following code should reproduce the issue

from selenium import webdriver
import time


def main():
    profile = webdriver.FirefoxProfile() 
    profile.set_preference("browser.link.open_newwindow", 3)
    profile.update_preferences()
    driver = webdriver.Firefox( firefox_profile=profile )
#    driver.get("http://www.ibm.com")
    driver.execute_script("window.open('http://www.google.com');") 
    driver.execute_script("window.open('http://www.yahoo.com');") 
    driver.execute_script("window.open('http://www.oracle.com');") 
    time.sleep(10)
    print driver.window_handles
    print driver.current_window_handle
    raw_input("Press Enter to continue...")
    driver.quit()

if __name__ == "__main__":
    main()




Reported by paoletto on 2012-02-15 20:27:30

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2012-02-19 16:11:20

  • Labels added: Lang-Python, Browser-Firefox, Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This is a known issue and unfortunately we will not be supporting tabs. 

We force Firefox to open all links in a new window. We can't access the tabs to know
when to switch. When we move to marionette (Mozilla project) in the future we should
be able to do this but for now it is working as intended

Reported by david.burns@theautomatedtester.co.uk on 2012-04-16 23:45:11

  • Status changed: WorkingAsIntended

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:14:48

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant