DarthOpto
DarthOpto

Reputation: 1652

AutoIT Script to Handle Chrome Authentication Window

I have the following script based on the following link: Here

If(Not IsArray($CmdLine) Or $CmdLine[0] < 2) Then
$user = InputBox ("User", "Please enter your user", "")
$pass = InputBox ("Password", "Please enter your password", "", "*M")
Else
$user = $CmdLine[1]
$pass = $CmdLine[2]
EndIf

WinWaitActive("", "Authentication Required", "120")
If WinExists("", "Authentication Required") Then
Send($user)
Send("{TAB}")
Send($pass)
Send("{ENTER}")
EndIf

This is not working for me, nothing is getting entered into the User name and password field when I run a test with this. I even created a script where I was simply sending a string to the user name and password fields and it is not working either.

Upvotes: 0

Views: 5286

Answers (1)

Mr. Llama
Mr. Llama

Reputation: 20889

(This was solved in the comments but I'm copying the answer here for future readers.)

It appears that the WinWaitActive command is never finding the login prompt that you're looking for. On Chrome 40 on Windows 7, the login prompt's only visible text is Chrome Legacy Window, not Authentication Required (which is what you're looking for).

I would recommend checking with the "AutoIt Window Info" tool that comes standard with AutoIt. Open a Chrome authentication box, freeze the Window Info tool, then check the "Visible Text" tab.

Upvotes: 2

Related Questions