title: headless browser with basic authentication
body: <p>I want to use a headless browser to test a website in an internal network. The site makes use of basic authentication rather than a login page though so I've thus far been using something like <a href="https://username:password@testsite.com" rel="nofollow">https://username:password@testsite.com</a> to access the site with my scripts.</p>
  
  <p>I tried looking but is there any headless browser that supports using something like that as a URL? </p>
  
  <p>I'm currently using HtmlUnitDriver with Selenium but it appears to not be working. When using the Firefox Driver, I'm able to log in just fine but I'm apparently getting  <code>401 - Unauthorized: Access is denied due to invalid credentials</code> when I try using HtmlUnitDriver.</p>
  
  <p>For reference, I'm just using a simple <code>driver.get(url)</code> to open the page.</p>
  
  <pre><code>HtmlUnitDriver driver = new HtmlUnitDriver();
  String url = "https://"+ uName + ":" + uPassword + "@" + testEnvironment;
  driver.get(url);
  System.out.println(driver.getTitle());
  </code></pre>