My AutoIt script:
WinWaitActive("User Authentication","","10")
If WinExists("User Authentication") Then
; Enter a username.
Send("prabu{TAB}")
Send("{TAB}")
;Enter a Password.
Send("Password")
Send("{TAB}")
Send("{SPACE}")
;Press Authenticate button.
Send("{TAB} {ENTER}")
EndIf
I "compiled" it to an .exe file and execute it from Selenium using:
Runtime.getRuntime().exec("C:\\Users\\Prabu\\Documents\\ds.exe");
But I want it to enter a different username and password every time. I intend to provide these to the script using command-line arguments (parameters if you will).
Is it possible to pass arguments/parameters to AutoIt scripts? If so, how should this be done and how do I access arguments/parameters provided to my script?
Changes to AutoIt script:
$username = $CmdLine[1]
$password=$CmdLine[2]
Send($username)
Send($password)
In Java :
String command="C:\\Users\\Prabu\\Documents\\ds.exe \"username1\" \"password1\"";
Runtime.getRuntime().exec(command);
Reference:
https://www.autoitscript.com/autoit3/docs/intro/running.htm#CommandLine http://seleniumocean.blogspot.in/2014/11/its-time-for-autoit-parameterizing.html