title: How to handle Browser Basic Authentication pop up window using Ruby gem 'selenium-webdriver', '~> 3.0'
body: <ol>
  <li><p>How can I handle via a ruby script the basic auth pop up window using <code>gem 'selenium-webdriver', '~&gt; 3.0'</code>,  or switch and enter a username and password to login pop up/alert window?</p></li>
  <li><p>Is there a way to edit firefox profile and add to there url and saved logins via the script ?</p></li>
  </ol>
  
  <p>Also I cant inspect from my browser the elements on the pup up/alert window in order to find the ids.</p>
  
  <p>The the basic auth pop up window not from the URL in <code>@driver.get 'url'</code> in my script, first I go to a different website, then click on some link and I got this basic auth pop-up window.
  It works when I type manually the user/pass from my browser.</p>
  
  <p>I got exception when I tried to do something like this: </p>
  
  <p><code>a = @driver.switch_to.alert</code></p>
  
  <p><code>a.send_keys("username")</code></p>
  
  <p><code>caught exception Missing 'value' parameter!</code></p>
  
  <p>Screenshot from <code>Chrome</code>- </p>
  
  <p><a href="https://i.stack.imgur.com/qFeeW.png" rel="nofollow"><img src="https://i.stack.imgur.com/qFeeW.png" alt="enter image description here"></a></p>
  
  <p>Screenshot from <code>Firefox</code>- </p>
  
  <p><a href="https://i.stack.imgur.com/iEXCX.png" rel="nofollow"><img src="https://i.stack.imgur.com/iEXCX.png" alt="enter image description here"></a></p>
  
  <p>This way <code>@driver.get 'https://username:password@mysite.com/mypage/'</code> doesn't work so well, its send me back to the login page, and pop up another window:</p>
  
  <p><code>You are about to log in to the site “launchpad.support.sap.com” with the username “username”, but the website does not require authentication. This may be an attempt to trick you. Is “launchpad.support.sap.com” the site you want to visit?</code></p>
  
  <p>I found some solutions in java but nothing in ruby :(</p>
  
  <p>Any help would be appreciated,</p>
  
  <p>Thanks!</p>