Cannot connect to Chrome on Selenium / Mountain Li

2019-09-18 18:18发布

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条回答
放荡不羁爱自由
2楼-- · 2019-09-18 18:56

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.

查看更多
登录 后发表回答