Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

It kind of sounds like you're trying to automate something for use at your work. If your employer has given you the task to do this automation work, then I personally believe that they need to provide you with what you need. In this case, that would be the use of a utility like the ones I suggested or you need access to key information from the source code. Of course, I've never been employed as a programmer before, so I guess there's a chance that I might be wrong about that.

Given the restraints that you're claiming that you have to work within, here's my thoughts on what to try.

First, you can check out the spy-- and spy examples from the Win32::GuiTest module. If you have Perl installed along with Win32::GuiTest, you already have those "installed". Just run them and see if those can help you out.

Secondly, you can try to use Win32::GuiTest module to come up with some code of your own to explore the window GUI object of the application that you're trying to automate. To help you get started, you can start with something like the code below. Of course, you will need to make some modifications to use your desired program instead of calc.exe. Also, you may need to dig deeper into the windows structure, but this should help get you started.

use strict; use warnings; use Win32::GuiTest qw(:ALL); system "start calc.exe"; sleep(1); my @windows = FindWindowLike(undef, "Calculator"); my @children = GetChildWindows($windows[0]); SetFocus($windows[0]); foreach my $child (@children) { my $id = GetWindowID($child); my $class = GetClassName($child); print "child: $id -- $class\n"; } SendKeys("%{F4}"); # Alt-F4 to exit

Out of curiosity, when you manually use the program that you're trying to automate, can you fully run that program using only the keyboard? If so, I would suggest punting on using PushButton and MouseClick functions. Instead, just go with the SendKeys function, which is providing "keyboard" input to the GUI based application.

In reply to Re^3: Win32::GuiTest control id by dasgar
in thread Win32::GuiTest control id by abt

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (7)
    As of 2018-06-24 02:40 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (126 votes). Check out past polls.