Monthly Archives: September 2010

Quick Tip: Changing selenium driver versions for Geb + Grails

If you’re running into problems with the included version of the Selenium drivers included with the Geb plugin in Grails, you can set the following in your buildConfig.groovy file to change it.

dependencies{
test( "org.codehaus.geb:geb-core:0.4-SNAPSHOT"){
   excludes( "selenium-common", "selenium-remote-client", "selenium-remote-client" )
}

test 'org.seleniumhq.selenium:selenium-common:2.0a4'
test 'org.seleniumhq.selenium:selenium-remote-common:2.0a4'
test 'org.seleniumhq.selenium:selenium-remote-client:2.0a4'

test 'org.seleniumhq.selenium:selenium-firefox-driver:2.0a4'
test 'org.seleniumhq.selenium:selenium-chrome-driver:2.0a4'
test 'org.seleniumhq.selenium:selenium-ie-driver:2.0a4'
test('org.seleniumhq.selenium:selenium-htmlunit-driver:2.0a4') {
exclude 'xml-apis'
}
}

In our latest project, for example, we found that the firefox driver craps out like a Microsoft product had a few issues with javascript page redirections, reverting to the 2.0a4 revision of the selenium drivers helped us get past this hurdle.

Notice that we had to change the dependencies on the pulled in geb-core jar file, and not use the Grails plugin jar exclusion mechanism. Also be careful not to use :latest-release for all your drivers, as they will override the version of selenium-commons you use.

This took me a little while to figure out while staring blankly at the grails dependency reports, so I thought I would share it here.

Advertisements