title: python + selenium webdriver : using authenticate method
body: <p>I am using python + selenium webdriver to automatize checks.
  I am stuck on websites that request http authentication through popup window.</p>
  
  <p>I am trying to use the "authenticate" method through the following code :</p>
  
  <pre><code>#init.
  driver = webdriver.Firefox()
  driver.get(url)
  #get to the auth popup window by clicking relevant link
  elem = driver.find_element_by_id("login_link")
  elem.click()
  #use authenticate alert method
  driver._switch_to.alert.authenticate("login", "password")
  </code></pre>
  
  <p>the (scarce) infos/doc related to this method indicates that it should submit the credentials provided &amp; validate http auth. It doesn't and I am getting the following error :</p>
  
  <blockquote>
    <p>File
    "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/alert.py",
    line 105, in authenticate
        self.driver.execute(Command.SET_ALERT_CREDENTIALS, {'username':username, 'password':password})   File
    "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
    line 201, in execute
        self.error_handler.check_response(response)   File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py",
    line 159, in check_response
        raise exception_class(value) selenium.common.exceptions.WebDriverException: Message: Unrecognized
    command: POST
    /session/c30d03e1-3835-42f5-ace0-968aef486b36/alert/credentials</p>
  </blockquote>
  
  <p>is there something I am missing here / has anybody come accross the same issue and resolved it ?</p>
  
  <p>PS : the <a href="http://username:password@url" rel="nofollow">http://username:password@url</a> trick doesn't work for me in my tests conditions.</p>