0

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
3
  • is there any website that i can try this on ?
    – PDHide
    Commented Apr 7, 2020 at 9:10
  • Could you add the error screenshot
    – PDHide
    Commented Apr 7, 2020 at 9:30
  • I really dont have any other website having this behaviour?? Commented Apr 8, 2020 at 6:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.