-1

enter image description here

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.

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 Answers1

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