0

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.

Community
  • 1
  • 1
DarthOpto
  • 1,640
  • 7
  • 32
  • 59
  • You wait until the window is active, then you check if it exists? What happens if you remove the `WinExists` check? – Mr. Llama Feb 03 '15 at 20:04
  • @Mr.Llama The same behavior. Absolutely nothing is happening. – DarthOpto Feb 03 '15 at 20:10
  • Is it ever making it past the `WinWaitActive` command? Try adding a `MsgBox` command afterwards to verify that it is. Be sure to check `WinWaitActive`'s return value to verify that it wasn't from a timeout. – Mr. Llama Feb 03 '15 at 20:16
  • I added a message box box right after the `WinWaitActive` command and that doesnt show up either – DarthOpto Feb 03 '15 at 20:28
  • There ya go then. AutoIt isn't seeing the authentication window. I just checked Chrome 40 on Windows 7 and it appears that the login prompt has the text `Chrome Legacy Window`, not `Authentication Required`. You should consult with the "AutoIt Window Info" tool that comes standard with AutoIt. It's quite handy. – Mr. Llama Feb 03 '15 at 20:36

1 Answers1

2

(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.

Mr. Llama
  • 20,202
  • 2
  • 62
  • 115