简体   繁体   中英

How to handle Windows Authentication with Selenium Webdriver and Internet Explorer 10?

I have issues to get through the windows authentication when creating an automation test (C#) with Selenium Webdriver using the InternetExplorer Driver.

(When using Firefox it works to access https//username:password@site.com but not with Internet Explorer 10 (windows 7) )

I tried to update windows registry according to this article but it didnt work for IE10: http://aleetesting.blogspot.se/2011/10/selenium-webdriver-tips.html

Can any friendly person help me with a good solution how to get through Windows authentication using https//username:password@site.com in IE10?

Or does anyone have a better way to handle windows authentication issue with Selenium webdriver?

Best Regards Carl

In Windows 7 you can use the Credentials Manager to save the credentials for your site in the vault. The authentication now goes automatic.

Just configure your system to allow windows authentication without prompting

Add your site into the Trusted Sites zone in Internet Properties and set "Automatic logon with current user name and password" in Local Intranet and Trusted Sites zones.

Here are the steps to configure this:

Search for the Internet Options tool on your system and launch it.

Click the 'Security tab > Trusted Sites icon', then click the 'Sites' button and enter the URL of your Trusted Site, then click Add. This should be the site under test.

Click 'Close' to close the Trusted Sites window.

Click on 'Security tab > Local intranet' then the 'Custom level...' button.

Scroll to the bottom and select the 'Automatic logon with current user name and password' option. It's under the 'Authentication > Logon' section.

Click OK to save the changes.

Repeat steps 6 and 7 for the 'Trusted Sites' zone also.

Click OK to save all the changes and close the Properties window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM