IELaunchURL()返回HRESULT 80070012(“没有其他文件.") [英] IELaunchURL() returned HRESULT 80070012 ('There are no more files.')

查看:287
本文介绍了IELaunchURL()返回HRESULT 80070012(“没有其他文件.")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am facing a bit of a problem when using IEDriver on Windows Server 2012 R2. On Windows 10, the ChromeDriver,IEDriver and GeckoDriver are working perfectly however, on the Windows Server only ChromeDriver works.

IEDriver返回OpenQA.Selenium.WebDriverException:意外 启动Internet Explorer时出错. IELaunchURL()返回了HRESULT 80070012(没有其他文件.")

IEDriver is returning OpenQA.Selenium.WebDriverException: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070012 ('There are no more files.')

我添加了以下配置:

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

版本:

  • IE 11.0.9600.17416
  • Selenium.WebDriver 3.5.1
  • IEDriverServer 3.6

我当前使用的代码是(C#):

The code I am currently using is this (C#):

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

任何人都可以帮助我解决此错误吗?

Can anyone please help me to fix this error?

推荐答案

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

Adding "options.EnsureCleanSession = true;" solved the issue for me:

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

我使用的来源提供的建议: IE11上的Selenium WebDriver :

Advice from the source I used: 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);

这篇关于IELaunchURL()返回HRESULT 80070012(“没有其他文件.")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆