var alert = driver.SwitchTo().Alert(); alert.SetAuthenticationCredentials("username", "password"); alert.Accept();