Selenium Grid 2从mac hub到windows节点

时间:2014-02-14 17:50:38

标签: selenium selenium-rc selenium-grid geb selenium-grid2

我正在设置selenium网格,以便能够在虚拟机中测试IE。我遇到了:

  

geb.driver.DriverCreationException:无法从回调

创建驱动程序

通常意味着找不到驱动程序。我指向正确的位置,但是有些东西不起作用。仅供参考我的集线器内部网IP地址。

以下是我的文件/命令:

从Mac中心终端:

  

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

从Windows节点终端:

  

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

我的GebConfig.groovy文件,其中实例化了驱动程序:

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

我的堆栈跟踪如下:

  

geb.driver.DriverCreationException:无法从回调创建驱动程序&#39; script13923985022291935133551 $ _run_closure2_closure5_closure9 @ 557c6200&#39;       在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)       在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)       在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)       at geb.driver.CachingDriverFactory $ SimpleCache.get(CachingDriverFactory.groovy:30)       在geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)       在geb.Configuration.createDriver(Configuration.groovy:354)       在geb.Configuration.getDriver(Configuration.groovy:343)       在geb.Browser.getDriver(Browser.groovy:105)       在geb.Browser.go(Browser.groovy:394)       在geb.Page.to(Page.groovy:184)       在geb.Browser.via(Browser.groovy:475)       在geb.Browser.to(Browser.groovy:434)       在geb.Browser.to(Browser.groovy:412)       在geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)       在com.bloomhealthco.functional.LoginTestSpec.User能够以管理员身份登录(LoginTestSpec.groovy:12)   引起:groovy.lang.GroovyRuntimeException:找不到匹配的构造函数:org.openqa.selenium.remote.RemoteWebDriver(java.net.URI,groovy.util.ConfigObject)       at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44)       在script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy)       在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)       ......还有14个

     

geb.driver.DriverCreationException:无法从回调创建驱动程序&#39; script13923985022291935133551 $ _run_closure2_closure5_closure9 @ 557c6200&#39;       在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)       在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)       在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)       at geb.driver.CachingDriverFactory $ SimpleCache.get(CachingDriverFactory.groovy:30)       在geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)       在geb.Configuration.createDriver(Configuration.groovy:354)       在geb.Configuration.getDriver(Configuration.groovy:343)       在geb.Browser.getDriver(Browser.groovy:105)       在geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)       在geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)       在geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)       at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)       在geb.Browser.report(Browser.groovy:775)       在geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:44)       在geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:39)   引起:groovy.lang.GroovyRuntimeException:找不到匹配的构造函数:org.openqa.selenium.remote.RemoteWebDriver(java.net.URI,groovy.util.ConfigObject)       at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44)       在script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy)       在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)       ......还有14个

     

geb.driver.DriverCreationException:无法从回调创建驱动程序&#39; script13923985022291935133551 $ _run_closure2_closure5_closure9 @ 557c6200&#39;       在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)       在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)       在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)       at geb.driver.CachingDriverFactory $ SimpleCache.get(CachingDriverFactory.groovy:30)       在geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)       在geb.Configuration.createDriver(Configuration.groovy:354)       在geb.Configuration.getDriver(Configuration.groovy:343)       在geb.Browser.getDriver(Browser.groovy:105)       在geb.Browser.clearCookies(Browser.groovy:483)       在geb.Browser.clearCookiesQuietly(Browser.groovy:491)       在geb.spock.GebSpec.resetBrowser(GebSpec.groovy:45)       在geb.spock.GebSpec.cleanup(GebSpec.groovy:67)   引起:groovy.lang.GroovyRuntimeException:找不到匹配的构造函数:org.openqa.selenium.remote.RemoteWebDriver(java.net.URI,groovy.util.ConfigObject)       at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44)       在script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy)       在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)       ......还有11个

此外,该节点可以在集线器中注册:

ip:4444/grid/console screenshot

我一整天都在搜索,看起来这应该有效。有没有人有任何建议或知道什么是错的?

先谢谢你。

1 个答案:

答案 0 :(得分:0)

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

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

您的GebConfig.groovy的剪辑是否与您在文件中的剪辑完全相同?我看到capabilities被定义为你片段中DesiredCapabilities的一个实例,所以我不明白为什么将配置对象作为第二个参数传递...我看不到它但是也许你哪儿有错字?使用Groovy配置脚本,如果您输错了某些内容,则会出现问题,因为您将获得一个新的空ConfigObject实例,而不是错误。

第二件事是,如果你在使用this constructor之后,第一个参数应该是URL而不是URI