Cannot connect to Chrome on Selenium / Mountain Lion

丶灬走出姿态 提交于 2019-12-11 16:23:51

问题


I updated my OSX to Mountain Lion yesterday and now my Selenium tests stopped working with Chrome. I re-installed the newest Chromedriver to /usr/local/bin and python selenium from pip.

I'm using the stock python 2.7 of mountain lion.

This python code used to work:

from selenium import webdriver
browser = webdriver.Chrome()

Now nothing happens. After a while I get the following exception:

WebDriverException: Message: u'Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome'

It works with Firefox. But Firefox returns some texts that contain <br> differently which causes my tests to fail. So I cannot just switch to Firefox.


回答1:


This is because of a version mismatch.

I had a lot of issues with v21 of Chrome + ChromeDriver, so you could try rolling back to v20 of both, however, try updating both Chrome + ChromeDriver to the latest versions.



来源:https://stackoverflow.com/questions/12314038/cannot-connect-to-chrome-on-selenium-mountain-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!