I am trying to access a webpage where I get a pop-up to enter username and password. With the code below I manage to enter the values the values but the problem is that when I first enter the username and then TAB the TAB will actually replace the username then jump to the password field. But then also the password is written in the "user field". The focus jumps back to the username.
var alert = driver.SwitchTo().Alert();
alert.SendKeys(_credentials.UserName);
System.Threading.Thread.Sleep(1000);
alert.SendKeys(Keys.Tab);
System.Threading.Thread.Sleep(1000);
alert.SendKeys(_credentials.Password);
System.Threading.Thread.Sleep(1000);
alert.Accept();
I have tried with below code as well but that only works for IE not Firefox.
var alert = driver.SwitchTo().Alert();
alert.SetAuthenticationCredentials(_credentials.UserName, _credentials.Password);
System.Threading.Thread.Sleep(1000);
alert.Accept();
Any idea how to come around this issue in Firefox?