Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 错误::SessionNotCreatedError:启动Internet Explorer时发生意外错误_Ruby_Automation_Cucumber_Internet Explorer 11_Watir - Fatal编程技术网

Ruby 错误::SessionNotCreatedError:启动Internet Explorer时发生意外错误

Ruby 错误::SessionNotCreatedError:启动Internet Explorer时发生意外错误,ruby,automation,cucumber,internet-explorer-11,watir,Ruby,Automation,Cucumber,Internet Explorer 11,Watir,无法使用“我的脚本”启动Internet Explorer,这会导致此错误 Selenium::WebDriver::Error::SessionNotCreatedError: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabl

无法使用“我的脚本”启动Internet Explorer,这会导致此错误

Selenium::WebDriver::Error::SessionNotCreatedError: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.
我为此做了大量研究,并找到了一些解决方案,但我无法更改IE浏览器设置,此处所有区域都禁用了“启用保护模式”复选框

此外,尝试使用所需的功能覆盖此代码,但未获得任何成功:

caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer(
                     :ignoreProtectedModeSettings => true,
                     :javascriptEnabled => true,
                 )
Watir::Browser.new :ie, http_client: client,:desired_capabilities => caps
我正在使用Cucumber与Ruby和Watir,浏览器是InternetExplorer11


请对此提出一些解决方法。

在对其进行持续研究后,问题得到解决

  • 大多数Stackoverflow和Github答案显示更改Internet选项中的设置,但由于权限限制,这些选项无法从我这里使用
  • LinkedIn的一篇博客文章。建议修改特定于internet explorer的注册表,但由于权限限制,我也无法编辑
  • 根据注册表修改的要点,我找到了一种通过
    PowerShell脚本
    对其进行编辑的方法,并找到了一些从Microsoft power shell脚本存储库重置Internet Explorer首选项的解决方案
  • 这一步取得了1个成功,但主要问题仍然是相同的,即我的IE 11没有启动,然后搜索“为所有区域启用受保护模式”,并得到了一些关于它的良好描述的帖子

    a

    b

    最后,在Powershell脚本中进行调整后,它可以正常工作,我的脚本在IE浏览器中也可以正常工作


  • 可能其中一个安全区域启用了保护模式。我建议您再次检查所有区域,并尝试禁用它。如果问题仍然存在,则您可以尝试与系统管理员联系以帮助您修改。问题已得到解决,首先我尝试通过编辑特定于浏览器选项的注册表来修复它,但我也没有权限。然后我尝试了一种使用脚本来修改它的方法,并找到了一个参考“powershell”脚本来从这里修改它,在脚本中进行了一些调整之后,它就工作了:DThanks用于共享该问题的解决方案。我建议你将你的答案作为这个帖子的答案,并尝试在48小时后将你自己的答案标记为这个问题的可接受答案。它可以在未来帮助其他社区成员解决类似的问题。谢谢你的理解我做到了!!谢谢@Deepak msfta如果可以,你也可以尝试接受它作为答案。