Has anyone had any experience using GUITest with Foxpro or other COM object Applications? My ultimate goal is to be able to automagically drive foxpro and other applications as part of the software testing process.

I'd be interested in hearing your experiences. Some of the apps I want to automate/test use foxpro classes and others use Active X. The method I used to find all the controls does not seem able to look inside these entities.

I have a handle for the control but I am at a loss as to how to proceed. How do I expose their buttons or other features so that I can activate them from a test script?

I think Win32::OLE might provide some help but the examples seem geared for a different purpose and I do not yet understand them.

Any help or suggestions would be greatly appreciated.

Script and output I used are posted below:

Script


use strict; use Win32::GUI @Win32::GUI::EXPORT_OK; use Win32::GuiTest @Win32::GuiTest::EXPORT_OK; use Data::Dumper; # Purpose Find Management and list all contents. $Win32::GuiTest::debug = 1; # Find StrataQA my @winHandle = FindWindowLike (undef,"Management"); unless (@winHandle != 0 ) { "No Management Window Found!!!\n";} print "Found Management Window.\n"; SetForegroundWindow ($winHandle[0]); # List Children my @winChildren = FindWindowLike ($winHandle[0]); print "There are ". @winChildren." children\n"; #List Children's Children foreach my $hChild (@winChildren){ print "For $hChild\n"; my @hGchildren = FindWindowLike ($hChild); print "There are ". @hGchildren." children for $hChild)\n\n"; }

Output
Found Management Window. Window Found(Text : '' Class : 'stratamgm8c000000' Handle: '591244') Window Found(Text : '' Class : 'CtlFrameWork_ReflectWindow' Handle: '853406') Window Found(Text : '' Class : 'StatusBar20WndClass' Handle: '1181028') Window Found(Text : '' Class : 'AfxOleControl42' Handle: '1181024') Window Found(Text : '' Class : 'AfxWnd42' Handle: '1181016') There are 5 children For 591244 Window Found(Text : '' Class : 'CtlFrameWork_ReflectWindow' Handle: '853406') Window Found(Text : '' Class : 'StatusBar20WndClass' Handle: '1181028') Window Found(Text : '' Class : 'AfxOleControl42' Handle: '1181024') Window Found(Text : '' Class : 'AfxWnd42' Handle: '1181016') There are 4 children for 591244) For 853406 Window Found(Text : '' Class : 'StatusBar20WndClass' Handle: '1181028') There are 1 children for 853406) For 1181028 There are 0 children for 1181028) For 1181024 Window Found(Text : '' Class : 'AfxWnd42' Handle: '1181016') There are 1 children for 1181024) For 1181016 There are 0 children for 1181016)

In reply to Using Win32::GUITEST for Win32 Applications containing ActiveX or other COM objects. by talwyn

Title:
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, details, 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, summary, 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.