即使在Grails中更新了Selenium依赖关系后,为什么我的Geb测试也返回“无法通过回调创建驱动程序”?

ry1633

我正在引用此先前的线程(geb.driver.DriverCreationException:无法从callback创建驱动程序)-但仍然存在问题。

我正在尝试在Grails 2.4.3下运行Geb功能测试,并且我将Selenium支持依赖项设置为2.42.2版。我也在2.43.1和2.45.0中尝试过。如果我尝试硒2.42.2或2.43.1,Geb会停顿而无法完成,如果使用2.45.0,它将彻底崩溃。

这些是我得到的错误:

  1. 如果我尝试使用Selenium支持2.42.2或2.43.1,则会收到以下错误消息:geb.driver.DriverCreationException:无法从回调创建驱动程序

  2. 如果我尝试使用Selenium支持2.45.0-我的浏览器将尝试运行Geb测试,但将返回“页面无法正确重定向”错误。

在我的Grails BuildConfig.groovy中,这是我现在设置的硒依赖关系:

 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"

    }
nd

我让Geb使用以下属性:

gebVersion = '0.10.0'
seleniumVersion = '2.43.1'

有关一些额外的信息,我有一个Gradle项目,该项目仅用于运行Geb测试,这是我build.gradle文件中特定于Ge​​b的数据我知道这些版本可以一起使用,希望它们对您有用。

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
    }
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档