AnujaT has asked for the wisdom of the Perl Monks concerning the following question:
Hi! i am automating one web application using perl and selenium which works irrespective of browser. As the selenium is built to work entirely on web technology,it can not handle dialog box or save as window. so autoit is the tool which is used to handle dialog box. here is the autoit script which handles dialog box.
when i call this script through command prompt using : Save_Dialog_FF "dialog_box name" "save" it handles that dialog box. but i have to call this script through perl. can anybody help me out? Thank you.f $CmdLine[0] < 2 then ; Arguments are not enough msgbox(0,"Error","Supply all the Arguments, Dialog title,Save/Cancel a +nd Path to save(optional)") Exit EndIf ; wait until dialog box appears WinWait($CmdLine[1]) ; match the window with substring $title = WinGetTitle($CmdLine[1]) ; retrives whole window title WinActive($title); ; if user choose to save file If (StringCompare($CmdLine[2],"Save",0) = 0) Then WinActivate($title) WinWaitActive($title) Sleep(1) ; If firefox is set the save the file on some specif location without +asking to user. ; It will be save after this point. ;If not A new Dialog will appear prompting for Path to save Send("{ENTER}") if ( StringCompare(WinGetTitle("[active]"),$title,0) = 0 ) Then WinActivate($title) Send("{ENTER}") EndIf if WinExists("Enter name") Then $title = WinGetTitle("Enter name") if($CmdLine[0] = 2) Then ; Save File WinActivate($title) ControlClick($title,"","Button2") Else ;Set path and save file WinActivate($title) WinWaitActive($title) ControlSetText($title,"","Edit1",$CmdLine[3]) ControlClick($title,"","Button2") EndIf Else ;Firefox is configured to save file at specific location Exit EndIf EndIf ; do not save the file If (StringCompare($CmdLine[2],"Cancel",0) = 0) Then WinWaitActive($title) Send("{ESCAPE}") EndIf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to call AutoIt script from perl
by Anonymous Monk on May 03, 2012 at 10:50 UTC | |
by Anonymous Monk on Jul 19, 2012 at 16:32 UTC | |
|
Re: How to call AutoIt script from perl
by Anonymous Monk on May 03, 2012 at 10:45 UTC |