IELaunchURL()返回HRESULT 80070012('没有更多文件。')

问题描述 投票:2回答:1

在Windows Server 2012 R2上使用IEDriver时,我遇到了一些问题。在Windows 10上,ChromeDriver,IEDriver和GeckoDriver工作正常,但在Windows Server上只有ChromeDriver可以使用。

IEDriver返回OpenQA.Selenium.WebDriverException:启动Internet Explorer时出现意外错误。 IELaunchURL()返回HRESULT 80070012('没有更多文件。')

我添加了这些配置:

  • 相同的保护模式
  • 注册表项更改
  • 添加了PATH

版本:

  • IE 11.0.9600.17416
  • Selenium.WebDriver 3.5.1
  • IEDriverServer 3.6

我目前使用的代码就是这个(C#):

InternetExplorerOptions options = new InternetExplorerOptions();
options.IgnoreZoomLevel = true;
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
return ieDriver = new InternetExplorerDriver("Path To IEDriver", options);

有人可以帮我解决这个错误吗?

c# selenium selenium-webdriver
1个回答
2
投票

添加“options.EnsureCleanSession = true;”为我解决了这个问题:

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.EnableNativeEvents = false;
options.EnsureCleanSession = true;

来自我使用的来源的建议:Selenium WebDriver on IE11

本地:

var options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
//Clean the session before launching the browser
options.EnsureCleanSession = true;

远程:

capabilities = DesiredCapabilities.InternetExplorer();
capabilities.SetCapability("ie.ensureCleanSession", true);
© www.soinside.com 2019 - 2024. All rights reserved.