【问题标题】:WebDriverException: Message: 'Can not connect to the ChromeDriver'WebDriverException:消息:“无法连接到 ChromeDriver”
【发布时间】:2015-02-26 16:46:19
【问题描述】:

尝试使用 selenium 和 Chrome 运行测试我遇到了这个错误:

$ python3.4 /var/lib/jenkins/scripts/testlink/pacote_deslogado.py
while not utils.is_connectable(self.port): /usr/local/lib/python3.4/site-packages/selenium/webdriver/chrome/service.py:70: ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('127.0.0.1', 54866)>

======================================================================
ERROR: test_a_h_nacional_deslogado (__main__.AHNacionalDeslogado)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/jenkins/scripts/testlink/pacote_deslogado.py", line 25, in setUp
self.driver = webdriver.Chrome(executable_path='/usr/bin/chromedriver')
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/chrome/webdriver.py", line 59, in __init__
self.service.start()
File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/chrome/service.py", line 74, in start
raise WebDriverException("Can not connect to the ChromeDriver")
selenium.common.exceptions.WebDriverException: Message: Can not connect to the ChromeDriver

我的 PATH 中有可用的 Chromedrive,它是可执行的,我安装了 Chromium-Browser。

我不知道我还能做什么。

【问题讨论】:

  • which chromedriver 的输出是什么?谢谢。
  • Chromedriver 2.14,Selenium 2.44。
  • 那一行就是“webdriver.Chrome()”

标签: python python-3.x selenium selenium-chromedriver


【解决方案1】:

phantomjs 出现同样的错误。 我通过编辑phantojs的路径解决了它; 之前的路径是非标准的:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-24
    • 2017-12-29
    • 1970-01-01
    • 1970-01-01
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多