Why does my Geb test return “failed to create driver from callback” even after updating my Selenium dependency in Grails?

99封情书 提交于 2020-01-11 06:23:31

问题


I am referencing this previous thread (geb.driver.DriverCreationException: failed to create driver from callback) - but am still having problems.

I am trying to run Geb functional tests under Grails 2.4.3 and I have my Selenium support dependency set to version 2.42.2. I've also tried it with 2.43.1 and 2.45.0. Geb will stall out and not finish if I try Selenium 2.42.2 or 2.43.1, and it will outright crash if I use 2.45.0.

These are the errors I get:

  1. If I try Selenium support 2.42.2 or 2.43.1, I get this error: geb.driver.DriverCreationException: failed to create driver from callback

  2. If I try Selenium support 2.45.0 - My browser will try to run the Geb test but will return a "The Page Is Not Redirectly Properly" error.

In my Grails BuildConfig.groovy, here is the selenium dependency as I have it set right now:

 def seleniumVersion = "2.45.0"

  dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
        // runtime 'mysql:mysql-connector-java:5.1.29'
        // runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
        compile 'org.dbunit:dbunit:2.5.0'
        test "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
        test "org.gebish:geb-spock:$gebVersion"
        compile "org.springframework:spring-orm:4.0.5.RELEASE"
        // need for select objects
        test "org.seleniumhq.selenium:selenium-support:2.45.0"

    }

回答1:


I have Geb working with the following properties:

gebVersion = '0.10.0'
seleniumVersion = '2.43.1'

For a little extra info, I have a Gradle project that is only used to run Geb tests, and this is the Geb specific data in my build.gradle file. I know these versions will work together, hopefully they can be of use to you.

ext {
    // The drivers we want to use
    drivers = ["firefox", "chrome", "phantomJs"]

    ext {
        groovyVersion = '2.3.6'
        gebVersion = '0.10.0'
        seleniumVersion = '2.43.1'
        chromeDriverVersion = '2.10'
        phantomJsVersion = '1.9.7'
    }
}

dependencies {
    // If using Spock, need to depend on geb-spock
    testCompile "org.gebish:geb-spock:$gebVersion"
    testCompile("org.spockframework:spock-core:0.7-groovy-2.0") {
        exclude group: "org.codehaus.groovy"
    }
    testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"

    // Drivers
    testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
    testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
    testCompile("com.github.detro.ghostdriver:phantomjsdriver:1.1.0") {
        // phantomjs driver pulls in a different selenium version
        transitive = false
    }
}


来源:https://stackoverflow.com/questions/30085879/why-does-my-geb-test-return-failed-to-create-driver-from-callback-even-after-u

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!