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

The post I'm replying to doesn't have any code, if you have replaced the code in your first post in this tread you've just invalidated several responses to your original code. I'm sure you can see how confusing this thread will now look. My advice would be to change it back and post your updated code rather than replace what you had.

Replies are listed 'Best First'.
Re^10: Gui Automation using guitest
by shayak (Acolyte) on Feb 15, 2011 at 10:36 UTC
    #! 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("~"); } }

      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..