0

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.

4

1 回答 1

0

从您的堆栈跟踪中,我可以看到无法创建驱动程序的真正原因是:

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

您的 GebConfig.groovy 的片段与您在文件中的片段完全相同吗?我看到它capabilities被定义为DesiredCapabilities你的代码片段中的一个实例,所以我不明白为什么将配置对象作为第二个参数传递......我看不到它,但也许你在某个地方有错字?使用 Groovy 配置脚本时,如果您输入错误,您将遇到问题,因为您将得到一个新的空ConfigObject实例而不是错误。

第二件事是,如果您在使用此构造函数URL之后,第一个参数应该是 an而不是 a 。URI

于 2014-02-15T16:13:33.830 回答