I've faced this problem before and  I came to know that this is not possible
as replied by one of the group member.if window is minimised then that
window cant be focussed.


in my application , there is a link in a page and if you click that the
popwerpoint version of the same would be downloaded and the file download
window (open/save/cancel options)would appear. so if VMware is minimised
then the test get hang.

actually my testing scenario was like go to the page
click that link
open the downloaded powerpoint file (earlier i was saving the downloaded ppt
by clicking save in the file download prompt and opening the same file later
on)
test the powerpoint file
close the powerpoint

so due to this problem i changed the setting in the registry key so that if
the link is clicked the powerpoint version would be opened immediately
without the file window prompt ( open/save/cancel options) . then i test the
powerpoint and then close the same.

it worked ok in vmware , build server even if the system is minimised.

problem:- there is one drawback that whenever there is new msoffice patch
will be rolled out then it would come back to its default position ( i.e
clicking the link would trigger that file download window ( open/save/cancel
options) ) so on that case test would fail and you need to manually do the
registry key settings again.

I am not sure what type of file gets downloaded in your application but for
powerpoint kind of files you don't need autoit. it can be done through
win32ole.

Regards
Arihan

On Fri, May 21, 2010 at 10:38 PM, koicat <pmn...@yahoo.com> wrote:

> Am running ruby and watir 1.6.5 which uses AutoItX3.dll (v. 3.1.1) on
> a Windows Server 2003 virtual machine accessed from an XP Pro laptop
> through Remote Desktop.
>
> If I run the script and leave the desktop window open, the following
> code runs correctly.
> If I minimize the window the code hangs after the WinActivate command
> (the WinWait for "Save As" also never times out)
>
> Have substituted a newer version of AutoItX3.dll (v 3.3.3) to no
> avail.
>
>    @Wait = 60
>    data_path = [full path where file is to be saved]
>    ...
>    ai = WIN32OLE.new("AutoItX3.Control")
>    ai.WinWait("File Download", "", @Wait)
>    ai.WinActivate("File Download", "")
>    ai.ControlFocus("File Download", "", "&Save")
>    sleep 1
>    ai.ControlClick("File Download", "", "&Save", "primary")
>    sleep 1
>    ai.WinWait("Save As", "", @Wait)
>    sleep 0.5
>    ai.ControlSend("Save As", "", "Edit1", data_path)
>    ai.ControlClick("Save As", "", "&Save", "left")
>    ai.WinWait("Download complete", "", @Wait)
>    ai.ControlClick("Download complete", "", "Close")
>    ...
>
> This is an urgent problem as the application running this is a
> critical path project.
> Greatly appreciate any help anyone can give!
>
> --
> 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<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