带有 IE11 的 Selenium WebDriver:调用目标抛出异常

Selenium WebDriver with IE11: Exception has been thrown by the target of an invocation

在 IE9 下一切正常。我升级到IE11,一切都开始了。

我的代码在初始化驱动程序时失败(TargetInvocationException

Type[] types = { typeof(InternetExplorerDriver), typeof(ChromeDriver) };
foreach (Type t in types) {
   driver = (IWebDriver)Activator.CreateInstance(t); //Throws exception in title
...

在WIN7上。 I have the registry update as described.

我发现的大多数地方都经过了这一步,并且在使用 webdriver 时出现异常。我还没到...

显然,在途中错过了另一个更新。从 IE9 升级到 IE11 时,这一行(来自 OP 中的 link)很重要:

Additionally, "Enhanced Protected Mode" must be disabled for IE 10 and higher. This option is found in the Advanced tab of the Internet Options dialog.

请勿跳过!