Search code examples
javagrailsseleniumubuntu-12.04functional-testing

Selenium Caution: '/usr/bin/google-chrome': file is a script file, not a real executable. The browser environment is no longer fully under RC control


I am getting the above error when I run a functional test-case in a Grails project using Selenium 2.0.RC1 plugin on Ubuntu 12.0.4.


Solution

  • The error happens when you have this in your SeleniumConfig.groovy file:

    browser = "*googlechrome /usr/bin/chromium-browser"

    You should actually be referencing the binary distribution file:

    browser = "*googlechrome /opt/google/chrome/chrome"

    But you can only do this if you have google-chrome installed in Ubuntu and NOT chromium-browser (some Linux distributions package up Chromium for easy installation - see here http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome)

    To determine what you have, open a command and type:

    whereis google-chrome

    If you get a blank back (or just the words google-chrome) then you know you don't have google-chrome. Next type:

    whereis chromium-browser.

    If this returns something like /usr/bin/chromium-browser then you know you have chromium-browser and you need to update to google-chrome to fix this error (https://www.google.com/intl/en/chrome/browser/?platform=linux)

    Once you've installed google-chrome, replace the browser line in SeleniumConfig.groovy with this:

    browser = "*googlechrome /opt/google/chrome/chrome"