Basic authentication with Selenium in Internet Explorer 10

给你一囗甜甜゛ 提交于 2019-12-17 16:29:02

问题


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.

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

username:password@host.ext

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?


回答1:


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

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

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.

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

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


来源:https://stackoverflow.com/questions/23498710/basic-authentication-with-selenium-in-internet-explorer-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!