Loading ...
Sorry, an error occurred while loading the content.

RE: [perlguitest] Newbie Question...

Expand Messages
  • Mike Springer
    Ken, I went through the newbie stage 6 months ago, and can tell you that most of this module is learned by trial and error. I ve copied in two sub routines I
    Message 1 of 4 , Oct 2, 2003
    • 0 Attachment
      Ken,

      I went through the newbie stage 6 months ago, and can tell you
      that most of this module is learned by trial and error. I've copied in two
      sub routines I made for detecting windows in a Windows install of our
      Application. The second subroutine is just a simple way to send keystrokes.
      After that you'll have the basics. I apoligize for the simplistic code to
      all the Perl Guru's out there. The code is often troubleshooted by non perl
      users so I have to keep it easily read and not the most code efficient.

      # Call Example &waitfornextwindow("Customer Information","Screen 3 -
      Customer Information");
      sub waitfornextwindow
      {
      &log($_[1]); # write out to the log
      &log("Begin waiting for window $_[0]");
      while ((@windows = Win32::GuiTest::FindWindowLike(0, "$_[0]",
      "")) == 0)
      {
      sleep $sec+1;
      $totalsleep += ($sec+1);
      if ($totalsleep > 1000) {exit();}
      }
      &log("Found window $_[0] after $totalsleep seconds");
      $totalsleep=0;
      sleep $sec;
      @windows = Win32::GuiTest::FindWindowLike(0, "$_[0]", "");
      SetForegroundWindow("$_[0]") if scalar @windows == 1;
      &log("Window $_[0] brought to the foreground");
      }


      #######################################
      # Send Special Key
      #
      # Called example &typing("N",3);
      #######################################
      sub typing
      {
      if ($_[1] == 0) { SendKeys "$_[0]";&log("$_[0] typed");}
      # Regular text
      if ($_[1] == 1) { SendKeys "{$_[0]}";&log("\{$_[0]\} typed");}
      # Special Key such as SPACE, or TAB
      if ($_[1] == 2) { SendKeys "^{$_[0]}";&log("^\{$_[0]\} typed");}
      # Ctrl-Key <ctrl>c
      if ($_[1] == 3) { SendKeys "%{$_[0]}";&log("%\{$_[0]\} typed");}
      # Alt-Key
      }


      Mike Springer

      -----Original Message-----
      From: Ken [mailto:krc2700@...]
      Sent: Wednesday, October 01, 2003 8:23 AM
      To: perlguitest@yahoogroups.com
      Subject: [perlguitest] Newbie Question...

      To the list,

      I have recently downloaded and installed the tool and now am in the
      need of a tutorial.

      Is there a tutorial on how to get started??

      Thanks,

      Ken Crismon





      Yahoo! Groups Sponsor


      ADVERTISEMENT

      <http://rd.yahoo.com/M=256694.4002236.5216697.1261774/D=egroupweb/S=17050069
      51:HM/A=1784493/R=0/id=noscript/SIG=11q7p9e7k/*http://webevents.yahoo.com/un
      iversal/intolerablecruelty/>


      <http://us.adserver.yahoo.com/l?M=256694.4002236.5216697.1261774/D=egroupmai
      l/S=:HM/A=1784493/rand=767929418>

      To unsubscribe from this group, send an email to:
      perlguitest-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo!
      <http://docs.yahoo.com/info/terms/> Terms of Service.


      [Non-text portions of this message have been removed]
    • Dennis K. Paulsen
      The examples under the eg/ will be most helpful in addition to the core module documentation (README.txt or `perldoc Win32::GuiTest`)... Also, having a copy
      Message 2 of 4 , Oct 3, 2003
      • 0 Attachment
        The examples under the eg/ will be most helpful in addition to the
        core module documentation (README.txt or `perldoc
        Win32::GuiTest`)... Also, having a copy of MSDN handy might be
        helpful, as a good portion of the functions in Win32::GuiTest simply
        correspond to those functions from the Windows API.

        Regards,
        D
        --- In perlguitest@yahoogroups.com, "Ken" <krc2700@y...> wrote:
        > To the list,
        >
        > I have recently downloaded and installed the tool and now am in
        the
        > need of a tutorial.
        >
        > Is there a tutorial on how to get started??
        >
        > Thanks,
        >
        > Ken Crismon
      • Kristofer Hoch
        ... http://msdn.microsoft.com/library/default.asp ... Version: 3.12 GIT d s+:++ a C++ UL++ US+ P+++ L++ W+++ w PS PE t++ b+ G e r+++ z++++ ...
        Message 3 of 4 , Oct 3, 2003
        • 0 Attachment
          > Win32::GuiTest`)... Also, having a copy of MSDN handy might be
          > helpful, as a good portion of the functions in Win32::GuiTest simply
          > correspond to those functions from the Windows API.

          http://msdn.microsoft.com/library/default.asp




          =====
          -----BEGIN GEEK CODE BLOCK-----
          Version: 3.12
          GIT d s+:++ a C++ UL++ US+ P+++ L++
          W+++ w PS PE t++ b+ G e r+++ z++++
          ------END GEEK CODE BLOCK------

          __________________________________
          Do you Yahoo!?
          The New Yahoo! Shopping - with improved product search
          http://shopping.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.