Question

My application uses the following versions:

  • Geb: 0.9.2
  • Selenium: 2.26.0
  • Grails: 2.1
  • Spock: 0.7

And I'm running on a linux box with the following:

  • Firefox: 14
  • Centos: 5.3

I have a grails application and I am using Geb in the functional test phase.

If I'm starting from a clean environment (.grails has been wiped) and I run my tests they all go through fine, geb runs up firefox, does the tests and gives me the report.

However subsequent runs of the functional tests all tests will fail with:

geb.giver.DriverCreationException

which is apparently caused by:

java.lang.NoSuchMethodException

Now if I trash my .grails and run again, the next time the pass fine. Just want to be able to run the tests consistently.

Any help would be greatly appreciated!

Cheers

UPDATE:

Below is the gist of the stack trace (copied by hand so apologies for any typos):

geb.driver.DriverCreationException: failed to create driver from callback 'GebConfig$_run_closure@6f61a3c4'
    at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
    at geb.driver.CalbackDriverFactory.getDriver_closure3(CachingDriverFActory.groovy:80)
    ...

Caused by: java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init>(Ljava/lang/string;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:59)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:48)
    at org.openqa.selenium.remote.HttpCommandExecuter.<init>(HttpCommandExecuter.java:118)
    ...
Was it helpful?

Solution

I had this exact issue in the past. Exactly with HttpDriver classes in the stacktrace and happening on the second run after a clean. It's due to some of your Grails plugins pulling in a conflicting version of HttpClient.

I found that it's usually a plugin that transitively pulls in the release plugin but doesn't exclude it from exporting. The way to find the culprit is to go through all of your installed plugins for that app in your .grails directory and looking at their dependencies to find the one that is pulling the release plugin in and then either remove it or update it to a newer version as more and more plugin authors are excluding release plugin from exporting and I also believe that latest versions of release plugin don't depend on HttpBuilder anymore.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top