Road to handle http authentication in webdriver

One of my applications had Http authentication for security purpose and I had need to automate using webdriver. As we know http authentication is not a part of DOM object so we cannot handle it using webdriver. Here is approach to handle such type situation.

We need to pass http credential with URL to skip http popup authentication window. Below is URL format.


User above formatted URL in webdriver get method:


After using above approach, http authentication popup window disappear. But in Internet explorer, it raise error with message “wrong format url”. To accept same type url in internet explorer browser we need to add a DWORD value named exploere.exe and iexplore.exe  with value data 0 in below registry.
To open registry, open "regeidt" from run command.

  1. For all users of the program, set the value in the following registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE
  2. For the current user of the program only, set the value in the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE 
  3. If you are using 64 bit machine, set the value in the following registry key. HKEY_CURRENT_USER\Software\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE

3 comments:

  1. Thanks for this post, It is very helpful.

    ReplyDelete
  2. Great Blog..Very useful :)

    ReplyDelete
  3. "http://XXXXX:XXXXX@10.13.88.115:8000/EnterpriseConsole" used like this in get method,but still credentials pop up windows gets prompted.Using webdriver c#

    ReplyDelete

Leave your comments, queries, suggestion I will try to provide solution