Hii,
I am using selenium rc with java and trying to upload file for test using autoit. I am able to do the same, but I have to write a new script for each file to be uploaded for different scenarios.
Is there any way to pass file name as a parameter to the script, so that I can use only one script file.
I tried this but it gives Error: Array variable has incorrect number of subscript
Here is my script upload.au3:
#include<IE.au3>
If $CmdLine[0] < 2 Then
WinWait("Choose File to Upload")
$hChoose = WinGetHandle("Choose File to Upload")
ControlSetText($hChoose, "", "[CLASS:Edit; INSTANCE:1]",$CmdLine[1])
sleep(2000)
ControlClick($hChoose, "", "[CLASS:Button; INSTANCE:1]")
EndIf
And I am calling from java as below:
_selenium.click("id=movie-path");
String[] cmd = {path_to_file };
Process proc1 = Runtime.getRuntime().exec( "uploadfile3.exe",cmd);
Help needed...