为什么 driver.getPlaform() 在 Windows 10 中为 MicrosoftWebDriver for Edge 返回 ANY?
Why is driver.getPlaform() returning ANY for MicrosoftWebDriver for Edge in Windows 10?
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 的平台?
会话中返回的平台来自浏览器驱动程序可执行文件。它可能不完全是您传入的内容。如果浏览器驱动程序可执行文件(MicrosoftWebDriver.exe
在 Microsoft Edge 的情况下)在其对新会话的响应中返回 ANY
(或什么都没有),那就是被返回到您的代码。 Microsoft 需要更改其驱动程序才能更改此行为。
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 的平台?
会话中返回的平台来自浏览器驱动程序可执行文件。它可能不完全是您传入的内容。如果浏览器驱动程序可执行文件(MicrosoftWebDriver.exe
在 Microsoft Edge 的情况下)在其对新会话的响应中返回 ANY
(或什么都没有),那就是被返回到您的代码。 Microsoft 需要更改其驱动程序才能更改此行为。