Selenium RemoteWebdriver Edge 不起作用

标签 selenium grails selenium-grid

我有自己的 Selenium 网格和不同的 Windows 机器。其中之一是 Windows 10 机器。 Chrome 和 Firefox 可以工作,但我无法让 Edge 运行。

我的异常(exception):

geb.driver.DriverCreationException: failed to create driver from callback 'script1460298173607577952326$_run_closure3@6256ac4f'
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 机器上安装了 Microsoft WebDriver。

我在 gebconfig.groovy 中的代码
driver = {
        DesiredCapabilities capabilities = DesiredCapabilities.edge()
        capabilities.setPlatform(Platform.WIN10)
        new RemoteWebDriver(                    
                new URL("http://localhost:4444/wd/hub"), capabilities
        )
    }

我错过了什么?

最佳答案

我找到了解决方案。

在 windows 机器上,我必须在节点启动时添加以下参数:
Dwebdriver.edge.driver="C:/selenium/MicrosoftWebDriver.exe"-browser browserName="MicrosoftEdge",platform=WIN10

关于Selenium RemoteWebdriver Edge 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36531005/

相关文章:

python - 有没有办法在 python 中使用 selenium 获取 <div> 中的值?

multithreading - grails sessionFactory.currentSession.flushMode无法与线程一起使用?

selenium - 我可以在计算机 A 上运行 Selenium,并看到计算机 B 中的浏览器吗?

selenium - 使用 css 选择器在精确元素中按精确文本查找元素

c# - Webdriver 浏览器日志记录 IE C#

grails - Grails url映射从sperate配置文件传递数据

selenium - 如何在同一节点的不同浏览器版本中运行selenium代码?

c# - 如何在 Azure 开发测试实验室中部署 Selenium Grid

javascript - Webdriver.io 因 NoSessionIdError 崩溃

select - 如何在Grails中自定义选择标签