Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service geckodriver #270

Closed
ShaolongHu opened this issue Oct 10, 2016 · 11 comments
Labels

Comments

@ShaolongHu
Copy link

@ShaolongHu ShaolongHu commented Oct 10, 2016

  1. selenium 3.0.0b3
  2. geckodriver-v0.11.1-linux64.tar.gz unpacked to /bin /usr/bin
  3. firefox 48.02
  4. code:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
caps["binary"] = "/usr/bin/firefox"
driver = webdriver.Firefox(capabilities=caps)

  1. running:

Traceback (most recent call last):
File "test.py", line 3, in
browser = webdriver.Firefox()
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 68, in init
self.service.start()
File "/usr/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 92, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service geckodriver

Any idea?

Bests,

@andreastt

This comment has been minimized.

Copy link
Contributor

@andreastt andreastt commented Oct 10, 2016

Can you please paste the contents of the geckodriver.log file from your current working directory?

@ShaolongHu

This comment has been minimized.

Copy link
Author

@ShaolongHu ShaolongHu commented Oct 10, 2016

@andreastt

cat geckodriver.log
1476111009361 geckodriver INFO Listening on 127.0.0.1:58451

@andreastt

This comment has been minimized.

Copy link
Contributor

@andreastt andreastt commented Oct 10, 2016

I’m not able to reproduce this with selenium-3.0.0b3 off pip. It looks like geckodriver is starting successfully on the port the Python client is requesting it to, and that the client subsequently times out when attempting to connect on that port.

@andreastt andreastt added the selenium label Oct 10, 2016
@AutomatedTester

This comment has been minimized.

Copy link
Contributor

@AutomatedTester AutomatedTester commented Oct 11, 2016

@andreastt

This comment has been minimized.

Copy link
Contributor

@andreastt andreastt commented Oct 15, 2016

Closing this as I cannot reproduce.

@andreastt andreastt closed this Oct 15, 2016
@rsuciu-gsg

This comment has been minimized.

Copy link

@rsuciu-gsg rsuciu-gsg commented Nov 3, 2016

Reproducing for my team, using selenium 3.0.1 on Mac OS Sierra.
Tests fail to start with error:
Traceback (most recent call last):
File "test.py", line 4, in
driver = webdriver.Firefox()
File "/Users/sbhide/Desktop/virtualenv/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 135, in init
self.service.start()
File "/Users/username/Desktop/virtualenv/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 92, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service geckodriver

Any idea on what the problem might be? Please note that the same happens for chromedriver.

@jgraham

This comment has been minimized.

Copy link
Collaborator

@jgraham jgraham commented Nov 3, 2016

If it's happening for multiple drivers it sounds like a selenium issue.

@rsuciu-gsg

This comment has been minimized.

Copy link

@rsuciu-gsg rsuciu-gsg commented Nov 3, 2016

I'll report this for Selenium, thank you.

@andreastt

This comment has been minimized.

Copy link
Contributor

@andreastt andreastt commented Dec 9, 2016

@dongxiexidian If you had read the actual comments on this issue before commenting, you would have realised this is a Selenium issue.

@xxdd10

This comment has been minimized.

Copy link

@xxdd10 xxdd10 commented Oct 24, 2017

windows7 64
python 3.6
selenium 3.6
geckodriver 0.9

I resolved it .
remove the comment on hosts file
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 localhost

^0^

@mozilla mozilla locked and limited conversation to collaborators Oct 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.