When ChromeDriver doesn’t start up on non-english installation of windows xp

What an awful little error message this is:

WebDriverException: 
Message: u'unknown error: chrome failed to start\n  
(Driver info: chromedriver=2.0,platform=Windows NT 5.1 SP3 x86)'

I’ve spent more time than I’d like to admit to trying to figure out the “why” of this message.
This didn’t help much:
https://code.google.com/p/chromedriver/wiki/TroubleshootingAndSupport

Also, there’s a lot of useful info about making sure Selenium can locate ChromeDriver.exe.  All very good, but not what I was looking for.

This sent me in the right direction, but it’s section on overriding the binary_location shows outdated example code (or, at the very least it didn’t work for me in SWD v2.33)
https://code.google.com/p/selenium/wiki/ChromeDriver#Overriding_the_Chrome_binary_location

 The root cause

My installation of windows XP uses Spanish as it’s default language (I’m currently working in Barcelona).

The default install location for google chrome on Windows XP English is:

C:\Documents and Settings\<USERNAME>\Local Settings\
Application Data\Google\Chrome\Application\chrome.exe

on a Spanish installation this translates to:

C:\Documents and Settings\<USERNAME>\Configuración local\
Datos de programa\Google\Chrome\Application

ChromeDriver looks for Chrome in the default location and if it doesn’t find it, it returns the (wonderfully descriptive) error message quoted at the beginning of the post.

The ‘fix’

The following code allows me to launch ChromeDriver successfully (using the python bindings):

import unittest
from selenium import webdriver

class Test_Login(unittest.TestCase):
    def setUp(self):
        chromeOptions = webdriver.ChromeOptions()
        chromeOptions.binary_location = "C:\\Documents and Setting\\myusername\\Configuración local\\Datos de programa\\Google\\Chrome\\Application\\chrome.exe"

        self.driver = webdriver.Chrome(chrome_options=chromeOptions)

So, now that the (bloody) tools are correctly configured I can actually start writing the tests. Hooray!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s