Jump to content
Sign in to follow this  
NTS

Process called for the autoit script keeps on running and unable to get the control to selenium

Recommended Posts

Hi,

I am trying to handle the File download popup in Internet explorer 11.

Here is my Selenium code:

    Process p=Runtime.getRuntime().exec("C:\\Users\\pramodix\\Documents\\save.exe");
    option.click();
    System.out.println("File downloaded");

Autoit script executes and the file is downloaded, but only after closing the window manually or by using "Winclose"  in autoit script, it prints the statement "File downloaded". Else it keeps on waiting and gives time out error.

Tried giving p.waitfor() still it did not work.

Autoit Script:

Sleep(5000)
Local $hIE = WinGetHandle("[Class:IEFrame]")
Local $hCtrl = ControlGetHandle($hIE, "", "[Class:DirectUIHWND1]")

If WinExists($hIE,"Internet Explorer") Then
    WinActivate($hIE,"Internet Explorer")
  ControlSend("Internet Explorer","","","{TAB}") ; Gives focus to Save Button
  Sleep(500)
  ControlClick("Internet Explorer","","Button2")
  Sleep(5000)
 WinClose($hIE,"Internet Explorer")
Else
 MsgBox(0, "Message", "No window exist", 7)
EndIf
Sleep(5000)

Kindly suggest me the ways to get the control to selenium without closing the window since i have other methods to run after this.
              

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...