简体   繁体   中英

Instance of Firefox WebDriver is not created with selenium python bindings

I installed selenium-python bindings and trying to create an instance of firefox web driver as below

>>> from selenium import webdriver
>>> driver = webdriver.Firefox()

I dont know whats wrong here and its displaying the following error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 51, in __init__
    self.binary, timeout),
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 44, in launch_browser
    self._wait_until_connectable()
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 81, in _wait_until_connectable
    self._get_firefox_output())
selenium.common.exceptions.WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: Error: cannot open display: :1100\n' 

Can any please let me know how to solve this ..............

The error says"cannot open display: :1100". Are you running it on a remote terminal? Make sure you can type "firefox" at the prompt and have the browser open (that is what Webdriver does - opens Firefox on your system and then trying to connect to it). If you are running it on a remote system, do a web search on connecting to X display remotely.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM