Ankur
I already know the code to handle a popup window via autoit if you know the
window tile.

Do you have an idea about handling a popup where i dont know what is the
windowtitle?

Means handling unexpected popup window, which will like handle pop up
whatever may be the window title.

If you have that then please share else, this all code is available with
watir wiki itself.


Pallavi.

On Wed, Oct 21, 2009 at 2:59 PM, Ankur Gera <ankurg...@gmail.com> wrote:

>
> Hi Pallavi,
>
> Below is the respective code :-
>
> require 'watir'
> require 'win32ole'
>
> #Supply AutoItX3 as an argument to the constructor of WIN32OLE
> #for handling pop-up windows using WIN32OLE objects.WIN32OLE will act as an
> interface
> #for handling pop-up windows using AutoItX3 functions.
> ai = WIN32OLE.new("AutoItX3.Control")
>
> #New IE Browser window
> ie=Watir::IE.new
>
> #Go to AutoIt website
> ie.goto("http://www.autoitscript.com/autoit3/downloads.shtml";)
>
> #Click Download AutoIt image
> ie.image(:src,/download_autoit/).click_no_wait
>
>
> #Wait for the pop-up window with the specified title supplied to come
> res=ai.WinWait("File Download - Security Warning","",30)
> puts res  #Used for debugging purpose
>
> #Always try to Activate the pop-up window before using ControlClick fn()
> res=ai.WinActivate("File Download - Security Warning")
> puts res  #Used for debugging purpose
>
> #Click on the specified control on the pop-up window
> res=ai.ControlClick("File Download - Security Warning","","&Save")
> puts res  #Used for debugging purpose
>
>
> puts"\n" #Place the cursor on the next line
> #Wait for the pop-up window with the specified title supplied to come
> res=ai.WinWait("Save As","",30)
> puts res  #Used for debugging purpose
>
> #Always try to Activate the pop-up window before using ControlClick fn()
> res=ai.WinActivate("Save As")
> puts res  #Used for debugging purpose
>
> #Send the path in the pop-up window where you want to store the respective
> file
> res=ai.ControlSend("Save As","","Edit1", "C:\AutoItV3.exe")
> puts res  #Used for debugging purpose
>
> #Click on the specified control on the pop-up window
> res=ai.ControlClick("Save As","","&Save")
> puts res  #Used for debugging purpose
>
> #Close the IE Browser window
> ie.close
>
> Thanks & Regards,
> Ankur Gera
> TCS
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to