0
votes

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
What's your version of Chrome? What version of Selenium do you have? What version of the Chrome Driver do you have? - Arran
Chrome 21.0.1180.89, Selenium 2.25.0, Chromedriver 19.0.1068.0 - sbaechler
Update ChromeDriver to the latest version. The two must be kept in sync. I had a lot of issues with Chrome v21 and ChromeDriver v21, so I rolled back to v20 Chrome and v20 Chrome Driver. However, the main reason for your error is simply the two versions are heavily mismatched. The major (21 or 19) revision of the build must be the same for both Chrome & ChromeDriver - Arran
v21 and up sucks. It seems that elements that are outside of the viewport are not fully rendered and therefore not accessible. The tests only pass if I keep scrolling to make sure the tested elements are visible. Unfortunately I could not find a Chrome 20 installer. - sbaechler
Oldapps.com is a great site for getting older versions of software. This is how I got v20 of Chrome installed. - Arran

1 Answers

0
votes

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.