I am using python + selenium webdriver to automatize checks. I am stuck on websites that request http authentication through popup window.
I am trying to use the "authenticate" method through the following 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")
the (scarce) infos/doc related to this method indicates that it should submit the credentials provided & validate http auth. It doesn't and I am getting the following error :
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
is there something I am missing here / has anybody come accross the same issue and resolved it ?
PS : the http://username:password@url trick doesn't work for me in my tests conditions.