0
DesiredCapabilities edge = new DesiredCapabilities(Browser.EDGE, "", Platform.Windows); 
RemoteWebDriver driver = RemoteWebDriver(remoteAddress,edge); 
System.out.println(driver.getCapabilities().getPlatform()); 

即使将平台设置为Platform.Windows,也会将该平台打印为ANY。我正在使用Windows 10和最新的MicrosoftWebDriver.exe(10.0.14393)。我如何才能以Windows作为平台?为什么driver.getPlaform()在Windows 10中返回ANY for MicrosoftWebDriver for Edge?

回答

0

会话中返回的平台来自浏览器驱动程序可执行文件。它可能不是您传入的内容。如果浏览器驱动程序可执行文件(在Microsoft Edge的情况下为MicrosoftWebDriver.exe)在其响应中为新会话返回ANY(或没有任何内容),则返回到您的代码。微软将需要在其驱动程序中进行更改以改变此行为。

+0

谢谢你的回答。有什么方法可以知道Web驱动程序是否在Windows 10桌面环境中运行? –

+0

考虑到在撰写本文时,Microsoft Edge **仅**在Windows 10上运行,不包括服务器操作系统,我会说答案是肯定的。 – JimEvans

相关问题