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

I am editing and uploading the updated code.. The code which u r seeing now is the updated one after editing..

Replies are listed 'Best First'.
Re^9: Gui Automation using guitest
by marto (Cardinal) on Feb 15, 2011 at 10:30 UTC

    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.

      #! 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

Re^9: Gui Automation using guitest
by Corion (Patriarch) on Feb 15, 2011 at 10:34 UTC

    All that changing around won't help you. You need to learn programming, or at least some basic debugging skills. Following the points made in (for example) brian's Guide to Solving Any Perl Problem will also help.

      Thanx for the link. Actually im not at all a programmer. i have just a basic c knowledge. In my work i needed to do some testing manualy. Im just trying to automate it for my own good. In that process im learning perl also and then coding it..

        You will have to become a programmer then.

        You will find that a program needs to be far more specific than writing test specifications. Even though Perl might seem to accept a specification written in something almost like English, it will not do what you expect. You will need to learn to speak the same language as Perl, which is more than just using the same words that Perl uses.