0

I want to launch single Internet explorer instane as different user with Selenium. I referred to the following post but not getting anywhere.

How can I run Internet Explorer Selenium tests as a specific domain user?

Can you point me in the right direction how it can be achieved?

Community
  • 1
  • 1
Kiran
  • 747
  • 2
  • 10
  • 35
  • Please clarify the question. Are you trying to launch multiple `ie` instances with different credentials? – Saifur Mar 04 '15 at 13:12
  • Hi @Saifur I want to open single ie instance as different user. – Kiran Mar 04 '15 at 16:28
  • Using the same browser with 2 different selenium instances would lead to concurrency exception/error, hence is probably not implemented. Why not open 2 different browsers, each one binding to their own selenium instance ? However, if it is profile you are looking for: IE doesn't support the notion of "profiles" like Firefox or Chrome. You'll need to create the cookies yourself, probably using the cookie API of WebDriver. – Quote from JimEvans http://stackoverflow.com/questions/15294254/chrome-and-ie-driver-profiles-using-webdriver – Pierre-Luc Perron Jul 17 '15 at 11:16

1 Answers1

1

You can achieve that using URI authentication. For Google Chrome that behavior works without any additional changes, but for IE it blocked by default. You can unlock it by:

Set the DWORD value's value data to 1 in one of the following registry keys.

  • 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
  • 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

After that you will be able to use next URI to achieve your needs: http://username:password@host/ If you want to provide domain name, you need encode that like http://domain%5Cusername:password@host/

Source https://support.microsoft.com/en-us/kb/834489

mdementev
  • 145
  • 10