Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic authentication with Selenium in Internet Explorer 10

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:[email protected]

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?

like image 834
Stefan Jansen Avatar asked May 06 '14 15:05

Stefan Jansen


1 Answers

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
like image 98
Stefan Jansen Avatar answered Sep 20 '22 16:09

Stefan Jansen