MicrosoftWebDriver.exe应该预先安装在提升权限的命令提示符下 [英] MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt
问题描述
我的计算机上安装了以下版本的Microsoft Edge:
I have microsoft edge installed on my machine with below versions:
Microsoft Edge 44.18362.449.0
Microsoft EdgeHTML 18.18363
我正在尝试使用webdrivermanager
通过以下代码在Edge
上运行自动化测试(java+selenium
):
I am trying to use webdrivermanager
to run my automation test (java+selenium
) on Edge
by the below code:
WebDriverManager.edgedriver().setup();
driver = new EdgeDriver();
但是,它抱怨以下错误:
But, it complains with the below error:
WebDriverManagerException: MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
- 不是
webdrivermanager
下载并为我安装它吗? - 我该如何解决此问题?
- Shouldn't the
webdrivermanager
dowbload and install it for me? - How can i fix this issue?
推荐答案
此错误消息...
WebDriverManagerException: MicrosoftWebDriver.exe should be pre-installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
...表示 WebDriverManager 在启动/产生新的浏览过程中将无法安装最新版本的 MicrosoftWebDriver 二进制文件上下文,即 Microsoft Edge浏览器会话.
...implies that the WebDriverManager won't be able to install the latest version of MicrosoftWebDriver binary in the process to initiate/spawn a new Browsing Context i.e. Microsoft Edge Browser session.
根据 Microsoft EdgeHTML 18 时rel ="nofollow noreferrer"> Microsoft WebDriver :
As you are using Microsoft EdgeHTML 18 as per the documentation in Microsoft WebDriver:
Microsoft Edge的Microsoft WebDriver(EdgeHTML)版本18和19是Windows按需提供的功能,可确保始终自动保持最新状态,并提供了一些获取Microsoft WebDriver的新方法.
Microsoft WebDriver for Microsoft Edge (EdgeHTML) versions 18 and 19 is a Windows Feature on Demand which ensures that it’s always up to date automatically and enables some new ways to get Microsoft WebDriver.
步骤
要配置,您将必须启用开发人员模式:
Steps
To configure you will have to enable Developer Mode:
Go to Settings > Update and Security > For Developer and then select "Developer mode".
要安装,请通过提升权限的命令提示符运行 Microsoft Edge版本18 :
To install run Microsoft Edge version 18 through an elevated command prompt:
DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
注意:通过DISM
命令安装 MicrosoftWebDriver 时,默认情况下,Webdriver安装在以下子目录中:
Note: When installing MicrosoftWebDriver through the DISM
command, by default the webdriver is installed within the following sub-directories:
-
64位:
64 bit:
C:\\Windows\\SysWOW64\\MicrosoftWebDriver.exe
32位:
32 bit:
C:\\Windows\\System32\\MicrosoftWebDriver.exe
按照 Microsoft Edge开发人员指南:>
EdgeHTML 18包括Microsoft Edge平台的当前版本中自 Windows Insider 预览版本的更改,请参见 EdgeHTML中的新增功能.
EdgeHTML 18 includes the following new and updated features shipped in the current release of the Microsoft Edge platform, as of the Windows 10 October 2018 Update (10/2018, Build 17763). For changes in specific Windows Insider Preview builds, see the Microsoft Edge Changelog and What's New in EdgeHTML.
这篇关于MicrosoftWebDriver.exe应该预先安装在提升权限的命令提示符下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!