talwyn has asked for the wisdom of the Perl Monks concerning the following question:
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"; }
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Win32::GUITEST for Win32 Applications containing ActiveX or other COM objects.
by EdwardG (Vicar) on Nov 18, 2003 at 15:58 UTC | |
by talwyn (Monk) on Nov 19, 2003 at 01:47 UTC | |
by gmpassos (Priest) on Nov 20, 2003 at 00:27 UTC |