2014-02-14 33 views
0

我設置了硒網格以便能夠在虛擬機中測試IE。我遇到:Selenium Grid 2從mac集線器到windows節點

geb.driver.DriverCreationException:未能從回調

這通常意味着不被發現司機駕駛創建。我將它指向正確的位置,但某些內容無法正常工作。 FYI指的是我的中心機器的內部網IP地址。

這裏是我的文件/指令:

在Mac集線器終端:

Java的罐子硒 - 服務器 - 獨立-2.39.0.jar -role轂

從Windows節點終端:

C:\ selenium-server> java -jar selenium-server-standalone-2.39.0.jar -role node - 轂的http://:4444 /格/註冊-browser browserName = 「Internet Explorer的」,版本= 10.0,平臺= 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:無法創建在g從回調 'script13923985022291935133551 $ @ _run_closure2_closure5_closure9 557c6200' 司機eb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35) 在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80) 在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) 在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) at geb.Browser.to(Browser.groovy:434) at geb.Browser.to(Browser.groovy:412) at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51) at com。 bloomoalthco.functional.LoginTestSpec.User能夠以管理員身份登錄(LoginTestSpec.groovy:12) 引起:groovy.lang.GroovyRuntimeException:找不到匹配的構造函數:org.openqa.selenium.remote.RemoteWebDriver(java。 net.URI,groovy.util.ConfigObject) 在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:未能在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)創建回調 'script13923985022291935133551 $ @ _run_closure2_closure5_closure9 557c6200' 司機在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80) 在創業板.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) 在geb.driver.CachingDriverFactory $ SimpleCache.get(CachingDriverFactory.groovy:30) 在geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79) 在geb.Configuration .batser.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) 在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.gcleanup(GebReportingSpec.groovy:39) 引起:groovy.lang.GroovyRuntimeException:找不到匹配的構造函數:org.openqa.selenium.remote.RemoteWebDriver(java.net.URI,groovy.util.ConfigObject) at script13923985022291935133551.run_closure2_closure5_closure9(script1392398502229193 5133551.groovy:44) 在script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy) 在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29) ...... 14多個

geb.driver.DriverCreationException:沒有在geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)創建回調 'script13923985022291935133551 $ @ _run_closure2_closure5_closure9 557c6200' 司機 在geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80) 在geb.driver.CachingDriverFactory .getDriver_closure3(CachingDriverFactory.groovy) at geb.driver.CachingDriverFactory $ Simpl ebache.get(CachingDriverFactory.groovy:30) geb.Configuration.getDriver(Configuration。常規:343) 在geb.Browser.getDriver(Browser.groovy:105) 在geb.Browser.clearCookies(Browser.groovy:483) 在geb.Browser.clearCookiesQuietly(Browser.groovy:491) 在創業板spog.GebSpec.resetBrowser(GebSpec.groovy:45) at geb.spock.GebSpec.cleanup(GebSpec.groovy:67) 引起:groovy.lang.GroovyRuntimeException:找不到匹配的構造函數:org.openqa.selenium .remote.RemoteWebDriver(java.net.URI,groovy.util.ConfigObject) at script13923 985022291935133551.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

我整天都在尋找,似乎這應該工作。有沒有人有任何建議或知道什麼是錯的?

謝謝您的高級。

+0

你可以通過mac遠程登錄到windows機器,反之亦然嗎? – Amey

+0

我無法從Mac遠程登錄到Windows虛擬機,但我可以從Windows到Mac。我禁用了以相同結果結束的Windows防火牆。 – TIMBERings

+0

禁用防火牆後,您可以telnet到節點端口嗎?如果沒有,那麼硒網格將無法設置,端口需要監聽 – Amey

回答

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

+0

謝謝,看到我過去看到的錯誤,並忽略了堆棧跟蹤。這是URL與URI參數。之後,問題解決了。 – TIMBERings

相關問題