質問

I am setting up selenium grid to be able to test IE in a Virtual Machine. I am running into:

geb.driver.DriverCreationException: failed to create driver from callback

which generally means the driver is not being found. I'm pointing it to the correct location, however something isn't working. FYI refers to my hub machine's intranet IP address.

Here are my files/commands:

From Mac hub terminal:

java -jar selenium-server-standalone-2.39.0.jar -role hub

From Windows node terminal:

C:\selenium-server>java -jar selenium-server-standalone-2.39.0.jar -role node -hub http://:4444/grid/register -browser browserName="internet explorer",version=10.0,platform=WINDOWS -Dwebdriver.ie.driver=C:\IEDriverServer.exe

My GebConfig.groovy file where the drivers are instantiated:

ie {
    driver = {
        DesiredCapabilities capabilities = new DesiredCapabilities().internetExplorer().
        new RemoteWebDriver(new URI("http://<IP>:4444/wd/hub"), capabilities)
    }
}

My stack trace is as follows:

geb.driver.DriverCreationException: failed to create driver from callback 'script13923985022291935133551$_run_closure2_closure5_closure9@557c6200' at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35) at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80) at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30) at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79) at geb.Configuration.createDriver(Configuration.groovy:354) at geb.Configuration.getDriver(Configuration.groovy:343) at geb.Browser.getDriver(Browser.groovy:105) at geb.Browser.go(Browser.groovy:394) at geb.Page.to(Page.groovy:184) at geb.Browser.via(Browser.groovy:475) at geb.Browser.to(Browser.groovy:434) at geb.Browser.to(Browser.groovy:412) at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51) at com.bloomhealthco.functional.LoginTestSpec.User is able to login as an administrator(LoginTestSpec.groovy:12) Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject) at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44) at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy) at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29) ... 14 more

geb.driver.DriverCreationException: failed to create driver from callback 'script13923985022291935133551$_run_closure2_closure5_closure9@557c6200' at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35) at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80) at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30) at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79) at geb.Configuration.createDriver(Configuration.groovy:354) at geb.Configuration.getDriver(Configuration.groovy:343) at geb.Browser.getDriver(Browser.groovy:105) at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42) at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38) at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29) at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31) at geb.Browser.report(Browser.groovy:775) at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:44) at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:39) Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject) at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44) at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy) at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29) ... 14 more

geb.driver.DriverCreationException: failed to create driver from callback 'script13923985022291935133551$_run_closure2_closure5_closure9@557c6200' at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35) at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80) at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30) at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79) at geb.Configuration.createDriver(Configuration.groovy:354) at geb.Configuration.getDriver(Configuration.groovy:343) at geb.Browser.getDriver(Browser.groovy:105) at geb.Browser.clearCookies(Browser.groovy:483) at geb.Browser.clearCookiesQuietly(Browser.groovy:491) at geb.spock.GebSpec.resetBrowser(GebSpec.groovy:45) at geb.spock.GebSpec.cleanup(GebSpec.groovy:67) Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject) at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44) at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy) at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29) ... 11 more

Additionally the node can be registered with the hub:

ip:4444/grid/console screenshot

I've been searching all day and it seems this should work. Does anyone have any suggestions or know what's wrong?

Thank you in advanced.

役に立ちましたか?

解決

From your stacktrace I can see that the real reason for not being able to create the driver is:

 Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject)

Is the snipped of your GebConfig.groovy exactly the same as you have it in your file? I see that capabilities is defined as an instance of DesiredCapabilities in your snippet so I don't understand why would a config object be passed as the second parameter... I can't see it but maybe you have a typo somewhere? With Groovy config scripts you'll have issues if you mistype something as you will get a new empty ConfigObject instance instead of an error.

The second thing is that the first parameter should be an URL and not a URI if you're after using this constructor.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top