在Internet Explorer 10中使用Selenium进行基本身份验证 [英] Basic authentication with Selenium in Internet Explorer 10

查看:158
本文介绍了在Internet Explorer 10中使用Selenium进行基本身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的一个Web应用程序正在使用基本身份验证,并使用AngularJS进行构建.为了测试该应用程序,我使用了Protractor,后者使用Selenium与浏览器进行通信.

One of our webapplications is using Basic Authentication and build with AngularJS. To test this application, I use Protractor, which uses Selenium to communicate with browsers.

在Chrome中,一切正常,进行基本身份验证很容易:

In Chrome, everything works fine and doing basic authentication is easy:

username:password@host.ext

在Internet Explorer下,带有密码和用户名的URL被认为存在安全风险,因此是不允许的.在Internet Explorer 9之前,可以在注册表(FEATURE_HTTP_USERNAME_PASSWORD_DISABLE)中关闭此设置.为Internet Explorer 10设置此注册表项时,行为会发生变化(不显示错误,并且不使用用户名和密码即可重写URL),但是该功能似乎已损坏. Internet Explorer 11表现出与Internet Explorer 10相同的行为.

Under Internet Explorer, the URL's with password and username are expected to be a security risk and are therefor not allowed. Until Internet Explorer 9, this setting could be turned off in the registry (FEATURE_HTTP_USERNAME_PASSWORD_DISABLE). When setting this registry key for Internet Explorer 10, the behaviour changes (no error is displayed and the URL gets rewritten without the username and password) but the feature looks broken. Internet Explorer 11 shows the same behaviour as Internet Explorer 10 does.

有人有其他解决方法来绕过此问题吗?

Does anyone have a different workaround to bypass this problem?

推荐答案

我对Internet Explorer 10的升级也是对64位Internet Explorer的升级.出于某种原因,64位变体使用另一个寄存器密钥:

My upgrade to Internet Explorer 10 was also an upgrade to a 64-bit Internet Explorer. And for some reason, 64-bit variants use another register key:

HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Internet Explorer/MAIN/FeatureControl/FEATURE_HTTP_USERNAME_PASSWORD_DISABLE

在此注册表项中设置值为0DWORD iexplore.exe可解决此问题.

Setting a DWORD iexplore.exe with value 0 in this registry key fixes the issue.

64位变体也非常慢,切换回32位是解决此慢的好选择. IE的64位变体仅与IEDriverServer.exe的64位变体一起使用.使用IEDriverServer.exe 32位,可以切换回IE 32位.

The 64-bit variant is also very slow, and switching back to 32-bit is a good choice to fix this slowness. The 64-bit variant of IE is only used with the 64-bit variant of IEDriverServer.exe. Using IEDriverServer.exe 32-bit let you switch back to IE 32-bit.

为完整起见,32位的注册密钥为:

To be complete, the register key for 32-bit is:

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Internet Explorer/MAIN/FeatureControl/FEATURE_HTTP_USERNAME_PASSWORD_DISABLE

这篇关于在Internet Explorer 10中使用Selenium进行基本身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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