I have written below AutoIT script to handle the browser auth window as below.
I have parameterized script to get the uname & pwd from command line. With this parameterized script during execution it enters the values into the uname & pwd fields and hopefully clicks Ok as well but do not logs in actually & throws back the auth window like when we enter something wrong though all details are correct.
I tried hard-coding the login info into script & tried running then its working as expected.
I am not able to understand whats going wrong with the parameterized one. Can anyone help with it?
Below is the AutoIt code :
#include <MsgBoxConstants.au3>
$user=$CmdLine[1]
Sleep(5000)
if WinExists("Authentication Required") Then
WinActivate("Authentication Required")
Sleep(2000)
ControlSend("Authentication Required", "", "", $user&"{TAB}")
;ControlSend("Authentication Required", "", "", "Disconnect_123{TAB}")
Sleep(5000)
ControlSend("Authentication Required", "", "", $user&"{TAB}")
;ControlSend("Authentication Required", "", "", "Disconnect_123{TAB}")
Sleep(5000)
ControlSend("Authentication Required", "", "", "{ENTER}")
;ControlClick("Authentication Required", "OK", "controlID", "left", 1")
EndIf