That's good news, we can eliminate the title as a root cause in this
case.
Its an issue when running with Firefox,
as Firefox appends the name of the file being saved to the dialog's
title.

I'm sorry but I only have IE8 available to me, but have seen many
differences in behavior between IE6 & IE7 when working for clients
in the past, so I understand your frustration.

Can you tell what spawns the blank IE window that opened and does
NOT close with IE6 when the "Download Complete" dialog closes?
Was it spawned by a step performed prior to calling this function?

If the root case of what spawned that blank browser can't be
eliminated
try to attack the symptom it casused.
Use AutoIt to attach to that extra blank window and close it.
     # Create an AutoIt object
       oAutoIt = WIN32OLE.new("AutoItX3.Control")
      # Presuming that the title of the window in question is:
about:blank
       oAutoIt.WinClose("about:blank", "")

This would at least get the code working with IE6 without hanging.

Joe


On Jul 2, 4:13 am, asheesh misra <asheeshmisr...@gmail.com> wrote:
> Hi Joedio,
>
> Thanks for the reply. However, may I humbly submit that the titles have been
> hardcoded deliberately since they are the standard 'Save As', Download
> Complete' dialog boxes.
>
> Kindly suggest considering the titles as-is.
>
> Regards,
>
> Asheesh
>
> On Fri, Jul 2, 2010 at 3:27 AM, joedio <joe...@comcast.net> wrote:
> > Asheesh,
>
> > I see from the code you supplied that when running with IE6 you
> > are passing to AutoIt one title as a variable...
> >      window_title = "File Download"
> >      ai.WinWaitActive(window_title,prompt_message,1)
>
> > have another title hard coded as "Save As"
> >    ai.WinWait("Save As", "Save &in", 5)
>
> > and another window's title hard coded as "Download complete"
> >    ai.ControlClick("Download complete", "", "Close")
>
> > Have you manually verified that the titles of each those windows are
> > exactly the
> > same when opened via IE6 and IE7?
>
> > If they are not identical then you can either add if/then statements,
> > or perhaps use
> > regular expressions to identify the windows in a manner that matches
> > both
> > IE6 and IE7 titles, to account for that difference.
>
> > Joe
>
> > On Jul 1, 10:34 am, asheesh misra <asheeshmisr...@gmail.com> wrote:
> > > Hi All,
>
> > > I am newbie in Ruby/ WATIR and am struggling for the past 4 days with a
> > > slightly uncommon problem.
>
> > > The application I am trying to automate has a feature of exporting the
> > data
> > > table in .csv format.
>
> > > I use following function to save that exported .csv file:
>
> > > def SaveFileCorrectOne(filepath)
> > > ai = WIN32OLE::new('AutoItX3.Control')
> > > prompt_message = "Do you want to open or save this file?"
> > > window_title = "File Download"
> > > sleep 5
> > > ai.WinWaitActive(window_title,prompt_message,1)
> > > ai.ControlFocus(window_title, prompt_message, "&Save")
> > > ai.ControlClick(window_title,prompt_message,4427)
> > > ai.WinWaitActive("Save As","Save &in",2)
> > > ai.ControlSetText("Save As","Save &in",1148,filepath)
> > > ai.ControlClick(window_title,prompt_message,"&Save")
> > > ai.WinWait("Save As", "Save &in", 5)
> > > ai.ControlClick("Save As", "Save &in","&Save")
> > > ai.WinActivate("Save As","")
> > > ai.ControlFocus("Save As", "", "&Yes")
> > >     ai.ControlClick("Save As", "", "&Yes","left")
> > >     ai.WinWait("Download complete", "", 1)
> > >     ai.ControlClick("Download complete", "", "Close")
> > > end
>
> > > On IE 6, when this function is executed, the export process proceeds in
> > the
> > > following manner:
> > > 1. Export Button is clicked.
> > > 2. Save As dialog box appears (and behind this dialog box appears a blank
> > IE
> > > window.)
> > > 3. On saving the file (.csv file), the 'Download Complete' box is visible
> > > (and in the background the blank IE window is also visible).
> > > 4. On clicking the 'Close' button on the 'Download Complete' box, the box
> > > closes but the window doesn't close, and this hangs the script.
>
> > > On IE7, when the Export button is clicked, an IE window flashes and
> > > disappears, and the script moves ahead to the next task. The export of
> > the
> > > .csv file doesn't take place. In other words, the SaveFile function never
> > > gets called.
>
> > > Can anyone please, please help me.
>
> > > Regards,
>
> > > Asheesh
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: 
> > watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@googlegroups.com>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

Reply via email to