in reply to Re^9: Gui Automation using guitest
in thread Gui Automation using guitest

#! usr/bin/perl #use Win32::Gui; use Win32::GuiTest qw(:ALL); use strict; my $window = FindWindowLike( undef,"[Install*.*|*Setup.*]","" ); for($window) { SetForegroundWindow($window); my @hwnds = GetChildWindows($window); foreach(@hwnds) { SetForegroundWindow($_); my $var = GetWindowText($_); print "shayak"; print $var; my $class = GetClassName($_); print $class; #my $child = GetChildDepth(GetDesktopWindow(), $_); #print $child; if ($class eq ["*RadioButton"]) { my $id=GetWindowID($_); print $id; #CheckButton(GetWindowID($name); if (WMGetText($id)eq(["*agree*" ]or ["*accept*"])) { CheckButton($id); } else { SendKeys{"TAB"}; SendKeys{"UP"}; } } #PushButton("Next" or "Agree" or "Install" or "Yes" or "Fi +nish" or "Done"); SendKeys("~"); } }

Replies are listed 'Best First'.
Re^11: Gui Automation using guitest
by Corion (Patriarch) on Feb 15, 2011 at 10:39 UTC

    Seriously, your program can never have worked (except by accident). Start learning Perl and learning how to read documentation.

    Where in the documentation for Win32::GuiTest did you find the following usage?

    FindWindowLike( undef,"[Install*.*|*Setup.*]","" )

    This is not how it is shown to be used and can never work as intended.

    You need to stop guessing and making things up and you need to start learning programming, and how to read documentation, and then learn Perl.

    Update: Weakened first sentence

      Im just including a regular expression as i needed a window which says installation or setup or something similar thats why the * and it can have any extension so *.* . But this thing was working before..

        No test script can accept "or something similar". You have to be far more specific in what you mean by "something similar". * is not the way you tell Perl "or something similar". If you want to talk to Perl, you have to do it in a lanaguage it understands. See perlre or perlretut.

        That this part was "working before" is likely an accident and not something caused by your intention.

        You seem to be confusing wildcards for perl regular expressions, again as you've been advised you need to learn how to use the tool you've chosen. See prelre and prelrequick.