最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Running a Grails Hello World app with tests failing to start up firefox - Stack Overflow

programmeradmin1浏览0评论

On my Ubuntu 24.04 desktop, I've created a Virtual Machine also running Ubuntu 24.04 with Groovy, Grails installed. I want to work through the book "The Definitive Guild to Grails 2" - the first app is the gTunes which I've created and done the first controller to basically is the Hello World. I'm trying to run the "./gradlew check" and it fails when trying to use firefox to do a check..

Grails (Version 6.2.3; JVM Version 17.0.9) - groovy (2.4.21; JVM 17.0.14)

.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Process unexpectedly closed with status 1 Host info: host: 'grails-learning', ip: '192.168.122.23' Build info: version: '4.19.1', revision: 'abe0ee07dc' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.11.0-21-generic', java.version: '17.0.14' Driver info: .openqa.selenium.firefox.FirefoxDriver Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}]}] at app//.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114) at app//.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75) at app//.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61) at app//.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:162) at app//.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216) at app//.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174) at app//.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518) at app//.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:232) at app//.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:161) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:155) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:150) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:133) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:128) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:113) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:103) at app//geb.driver.NameBasedDriverFactory.getDriver(NameBasedDriverFactory.groovy:44) at geb.driver.CachingDriverFactory.getDriver_closure4(CachingDriverFactory.groovy:57) at geb.driver.CachingDriverFactory.getDriver_closure4(CachingDriverFactory.groovy) at app//geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:81) at app//geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:56) at app//geb.Configuration.createDriver(Configuration.groovy:700) at app//geb.Configuration.getDriver(Configuration.groovy:377) at app//geb.Browser.getDriver(Browser.groovy:163) at app//geb.Browser.retrieveCurrentUri(Browser.groovy:1192) at app//geb.Browser.go(Browser.groovy:504) at app//geb.Browser.go(Browser.groovy:482) at app//geb.spock.GebSpec.methodMissing(GebSpec.groovy:1) at app//gTunes.GTunesSpec.$tt__$spock_feature_1_0(GTunesSpec.groovy:16) at gTunes.GTunesSpec.test something_closure1(GTunesSpec.groovy) at app//groovy.lang.Closure.call(Closure.java:427) at app//groovy.lang.Closure.call(Closure.java:416) at app//grails.gorm.transactions.GrailsTransactionTemplate$1.doInTransaction(GrailsTransactionTemplate.groovy:68) at app//.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at app//grails.gorm.transactions.GrailsTransactionTemplate.executeAndRollback(GrailsTransactionTemplate.groovy:65) at gTunes.GTunesSpec.test something(GTunesSpec.groovy)

On my Ubuntu 24.04 desktop, I've created a Virtual Machine also running Ubuntu 24.04 with Groovy, Grails installed. I want to work through the book "The Definitive Guild to Grails 2" - the first app is the gTunes which I've created and done the first controller to basically is the Hello World. I'm trying to run the "./gradlew check" and it fails when trying to use firefox to do a check..

Grails (Version 6.2.3; JVM Version 17.0.9) - groovy (2.4.21; JVM 17.0.14)

.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Process unexpectedly closed with status 1 Host info: host: 'grails-learning', ip: '192.168.122.23' Build info: version: '4.19.1', revision: 'abe0ee07dc' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.11.0-21-generic', java.version: '17.0.14' Driver info: .openqa.selenium.firefox.FirefoxDriver Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}]}] at app//.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114) at app//.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75) at app//.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61) at app//.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:162) at app//.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216) at app//.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174) at app//.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518) at app//.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:232) at app//.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:161) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:155) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:150) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:133) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:128) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:113) at app//.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:103) at app//geb.driver.NameBasedDriverFactory.getDriver(NameBasedDriverFactory.groovy:44) at geb.driver.CachingDriverFactory.getDriver_closure4(CachingDriverFactory.groovy:57) at geb.driver.CachingDriverFactory.getDriver_closure4(CachingDriverFactory.groovy) at app//geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:81) at app//geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:56) at app//geb.Configuration.createDriver(Configuration.groovy:700) at app//geb.Configuration.getDriver(Configuration.groovy:377) at app//geb.Browser.getDriver(Browser.groovy:163) at app//geb.Browser.retrieveCurrentUri(Browser.groovy:1192) at app//geb.Browser.go(Browser.groovy:504) at app//geb.Browser.go(Browser.groovy:482) at app//geb.spock.GebSpec.methodMissing(GebSpec.groovy:1) at app//gTunes.GTunesSpec.$tt__$spock_feature_1_0(GTunesSpec.groovy:16) at gTunes.GTunesSpec.test something_closure1(GTunesSpec.groovy) at app//groovy.lang.Closure.call(Closure.java:427) at app//groovy.lang.Closure.call(Closure.java:416) at app//grails.gorm.transactions.GrailsTransactionTemplate$1.doInTransaction(GrailsTransactionTemplate.groovy:68) at app//.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at app//grails.gorm.transactions.GrailsTransactionTemplate.executeAndRollback(GrailsTransactionTemplate.groovy:65) at gTunes.GTunesSpec.test something(GTunesSpec.groovy)

Share Improve this question asked Apr 2 at 1:27 schu777schu777 3866 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

There's a couple of things you can try to resolve this issue and get tests running with Firefox.

Try updating the geckodriver version to '0.35.0' in your build.gradle file. I went to this page to see what the latest version of geckodriver is. I got an error running tests in my Grails 6.2.0 application when I specified version 0.36.0 (Driver url not found for name: "geckodriver", version regexp: "\Q0.36.0\E", platform: "mac", bit: "64", arch: "amd64"), but '0.35.0' worked!

webdriverBinaries {
    if (!System.getenv().containsKey('CI')) {
        ...
        geckodriver '0.35.0'
        ...
    }
}

Secondly, try updating your Selenium libraries to the latest version. I checked out the Maven repository for Selenium Firefox Driver to determine what the latest version was. At the time of writing, it is 4.30.0. You can then find and replace all instances of the old selenium version in your build.gradle file with the new version.

configurations {
    all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details->
            if (details.requested.group == '.seleniumhq.selenium') {
                details.useVersion('4.30.0')
            }
        }
    }
}

dependencies {
    ...
    testImplementation(".seleniumhq.selenium:selenium-api:4.30.0")
    testImplementation(".seleniumhq.selenium:selenium-remote-driver:4.30.0")
    testImplementation(".seleniumhq.selenium:selenium-support:4.30.0")
    ...
    testRuntimeOnly(".seleniumhq.selenium:selenium-chrome-driver:4.30.0")
    testRuntimeOnly(".seleniumhq.selenium:selenium-firefox-driver:4.30.0")
    testRuntimeOnly(".seleniumhq.selenium:selenium-safari-driver:4.30.0")
    ...
}
发布评论

评论列表(0)

  1. 暂无评论