I've seen many posts on this topic unfortunately, none of them work. I need to enter the username and password into the chrome authentication alert using Selenium Webdriver and C# code.
Asked
Active
Viewed 843 times
-1

Ankit Kumar
- 397
- 2
- 11
- 21

King81
- 83
- 2
- 10
-
There have been some complicated answers like AutoIT installation and create a script but this is a simple solution to the issue, that I had. – King81 Nov 23 '17 at 17:12
1 Answers
2
string userName = "username";
string userPassword = "password";
var url = "https://" + userName + ":" + userPassword + "@" + "example.com";
driver.Navigate().GoToUrl(url);

Moe Ghafari
- 2,227
- 1
- 12
- 17

Rikard
- 36
- 4
-
-
Thanks a lot Rikard & Moe, this worked for me to login into the application without navigating to the prompt – King81 Nov 23 '17 at 17:16
-
Is it working with firefox too ? In case of firefox you might get another pop up with Ok button. – Sandipan Pramanik Nov 24 '17 at 07:03
-
I didn't check this on Firefox as its not one of our official browser, we are only allowed to use Chrome and IE. I perform all my ATs on Chrome browser – King81 Dec 08 '17 at 10:23