Handle windows authentication pop up on Chrome

Pooja Mistry picture Pooja Mistry · Oct 14, 2013 · Viewed 14k times · Source

I am trying to handle the basic authentication pop up for my Selenium webdriver scripts using AutoIt. I wrote a script for Firefox and Internet Explorer but it doesn't work for Chrome.

When I tried identifying the authentication pop up on Chrome using AutoIt Window Information Tool it came up empty. I am using following AutoIt script:

WinWaitActive("Authentication Required","","120")
If WinExists("Authentication Required") Then
    Send("username{TAB}")
    Send("password{Enter}")
EndIf

Any pointers to get this to work would be helpful. I am not using username@password:google.com because some authentication pop ups appear on redirection.

Answer

Pooja Mistry picture Pooja Mistry · Oct 15, 2013

I was able to have AutoIt target the window by text, not window title. AutoIt Window Information Tool did not recognize the title but it did recognize the visible text.

So I changed the script to:

WinWaitActive("","Authentication Required","120")
If WinExists("","Authentication Required") Then
    Send("username{TAB}")
    Send("password{Enter}")
EndIf

It worked fine.