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

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

问题描述

我们的一个网络应用程序使用基本身份验证并使用 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

在此注册表项中使用值 0 设置 DWORD 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天全站免登陆