2016-04-10 131 views
0

我有我自己的Selenium網格與不同的Windows機器。其中之一是Windows 10機器。 Chrome和Firefox的作​​品,但我不能讓Edge運行。Selenium RemoteWebdriver邊緣不起作用

我的例外:

geb.driver.DriverCreationException: failed to create driver from callback '[email protected]' 
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35) 
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85) 
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) 
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32) 
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84) 
at geb.Configuration.createDriver(Configuration.groovy:382) 
at geb.Configuration.getDriver(Configuration.groovy:371) 
at geb.Browser.getDriver(Browser.groovy:108) 
at geb.spock.GebSpec.propertyMissing(GebSpec.groovy:60) 
at specs.LomnidoBaseSpec.setupSpec(LomnidoBaseSpec.groovy:28) 
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities [{platform=WIN10, browserName=MicrosoftEdge, version=}] 
Command duration or timeout: 382 milliseconds 
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
System info: host: 'peter-laptop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-85-generic', java.version: '1.8.0_45' 

我已經在Windows機器上安裝了微軟的webdriver。

我在gebconfig.groovy代碼

driver = { 
     DesiredCapabilities capabilities = DesiredCapabilities.edge() 
     capabilities.setPlatform(Platform.WIN10) 
     new RemoteWebDriver(     
       new URL("http://localhost:4444/wd/hub"), capabilities 
     ) 
    } 

我缺少什麼?

回答

2

我找到了解決方案。

在Windows機器上,我必須對我的節點啓動添加以下參數: Dwebdriver.edge.driver = 「C:/selenium/MicrosoftWebDriver.exe」 -browser browserName = 「MicrosoftEdge」,平臺= WIN10

0

彼得

Error forwarding the new session cannot find : Capabilities [{platform=WIN10, browserName=MicrosoftEdge, version=}] 

是告訴你,它沒有發現,正處於一個名爲「MicrosoftEdge」以其平臺設置爲「WIN10」瀏覽器的任何節點的網格的方式。

你需要回頭再看看你是如何產生你的節點,看看它是否需要調整一下。

要了解如何設置網格的一般概述,您可以查看我的this博客文章。

+0

嗨,謝謝你的回答,但你的博客並沒有幫助解決我的問題。我已經完成了將邊緣添加到節點的所有描述,但邊緣瀏覽器未註冊到我的集線器 – Peter

+0

我需要閱讀該博客文章。我試圖在grails項目中使用selenium獨立服務器,並且它在生產中失敗。從IntelliJ工作,希望這可以解決我的問題。 – Sulteric