blackadder has asked for the wisdom of the Perl Monks concerning the following question:
The command system ($item); runs a software installation script. If the installation did not start for any reason a popup message box entitled ‘GO’ will appear indicating this. What I need to do is to detect that such window has appeared to indicate that the installation has failed. The Win32::GUITest code that follows the system($item) – which will do the detecting for me will only run after the system command has finished , and with it the Popup message will also disappear – doesn’t work. Is there away where I can get my GUITest code to monitor and detect the 'GO' popup when the system($item) being executed?#! c:\perl\bin $|++; use strict; use Win32; use Win32::GuiTest qw(:ALL :SW); use vars qw /%data/; $data{apps_list} = shift @ARGV; $data{host} = Win32::NodeName(); system (cls); 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}}) { print "\n$item\n"; eval {system ($item); print "\n********* YOU ARE HERE ********\n"; my @windows = FindWindowLike(0, 'GO'); 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 #next if ($text =~ /^OK|Cancel|Abort|Retry|Ignore|Yes|No$/); # + you've found a button print "Found child $child with text '$text'\n"; } }}; Win32::AbortSystemShutdown($data{host}); print "\nDone\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Don't block
by PodMaster (Abbot) on May 14, 2004 at 11:21 UTC | |
by blackadder (Hermit) on May 14, 2004 at 11:53 UTC | |
by PodMaster (Abbot) on May 14, 2004 at 12:59 UTC | |
by blackadder (Hermit) on May 14, 2004 at 13:16 UTC | |
| |
|
Re: Win32::GUITest to run with System()
by Ven'Tatsu (Deacon) on May 14, 2004 at 14:02 UTC |