Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Only if the execution of this batch file was unsuccessful, then a popup window appears indicating the failure, otherwise no popup windows will appear. Also, those popups do not remain on the screen, they have a time out value of few seconds and they disappear soon after.$|++; use strict; use Win32; use Win32::GuiTest qw(:ALL :SW); use vars qw /%data/; system (cls); $data{apps_list} = shift @ARGV; $data{host} = Win32::NodeName(); print "\nThis machine is ". $data{host}; print "\n\nPath to apps list => ". $data{apps_list}."\n"; open (LST, "$data{apps_list}") || die "$! : File was not found\n"; chomp (@{$data{Go_scripts}} = <LST>); for my $item (@{$data{Go_scripts}}) { System ($item); Print "Testing => $item\n"; # # some code needs to be here to detect the popup! # Win32::AbortSystemShutdown($data{host}); }
However my problem is this, If I insert the above GUItest code after the System( ) command, then it will only run after System() has completed its excution and by then if there were any popups, then they would have disappeared.While (1) { my @windows = FindWindowLike(0, 'MYPOPUP'); for my $win (@windows) { print "Found window $win with title '", GetWindowText($win), "'\n"; my @children = GetChildWindows($win); for my $child (@children) { my $text = GetWindowText($child); next if ($text =~ /^\xff/); # you've found the icon + print "Found child $child with text '$text'\n" if ($text =~ /^ +OK$/)}}}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GUITest to test GUI
by Ven'Tatsu (Deacon) on May 17, 2004 at 14:48 UTC | |
|
Re: GUITest to test GUI
by EdwardG (Vicar) on May 17, 2004 at 12:42 UTC | |
by Anonymous Monk on May 17, 2004 at 12:58 UTC | |
by EdwardG (Vicar) on May 17, 2004 at 13:11 UTC | |
by tilly (Archbishop) on May 17, 2004 at 18:43 UTC | |
|
Re: GUITest to test GUI
by bbfu (Curate) on May 17, 2004 at 18:02 UTC | |
by Anonymous Monk on May 19, 2004 at 09:22 UTC | |
by bbfu (Curate) on May 20, 2004 at 21:20 UTC |