title: How to handle authentication popup in Chrome with Selenium WebDriver using Java
body: <p>I am trying to handle an authentication pop-up in one of my new Webdriver scripts.  I have a working solution for IE, but I am struggling with Chrome.  IE was as simple as following the advice on [this page]:<a href="https://stackoverflow.com/questions/24304752/how-to-handle-authentication-popup-with-selenium-webdriver-using-java?answertab=active#tab-top">How to handle authentication popup with Selenium WebDriver using Java</a>. That thread doesn't show a great solution for Chrome, although several commentors point out, that the solution does not work for Chrome.  The problem is, when you try to do the below code on Chrome, the login popup isn't an Alert.</p>
  
  <pre><code> WebDriverWait wait = new WebDriverWait(driver, 10);      
   Alert alert = wait.until(ExpectedConditions.alertIsPresent());     
   alert.authenticateUsing(new UserAndPassword(**username**, **password**));
  </code></pre>
  
  <p>It's not a windows level () authentication pop-up, the web page is simply password protected. I know there are several other instances of this question on Stack Overflow, but I don't see any more recently than 2 years old.  I am hoping there is a better solution now in 2017.  Thanks in advance.</p>