Recognizing MS PowerPoint Controls
I'm working on a test scenarios that requires clicking on various menu items in MS PowerPoint. I'm using SilkTest 6.0 SP1.
The captured definition recognizes the PPT window as a dialogbox with a bunch of CustomWin objects. It defines all the menu items (such as "File", "Edit", etc.) within an object "CustomWin MenuBar" without recognizing anything in the drop-down box. I tried to capture the definition of the drop-down box but it only recognizes the box as a DialogBox without any more details.
Now I can only do record and playback, which really is not sufficient for the tasks I'm facing.
I have a feeling that I'm missing something simple here. Does anyone have similar experience with MS PowerPoint, or MS Office applications in general?
Re: Recognizing MS PowerPoint Controls
I had a similar problem with a console application. I solved it by doing the following:
First I created a custom class for the unrecognized menu items:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] winclass ButtonMenuItem : AnyWin
[ ] setting DontInheritClassTag = TRUE
[-] Pick ()
[ ] STRING sMenuButton = [STRING] this
[ ] sMenuButton = GetField (sMenuButton, ".", 1) //determining the button to click
[ ] LogToolBar.ToolBar1.@sMenuButton.Click ()
[ ] this.Click ()
</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I then declared my DialogBox that contains the menu items as such:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] window DialogBox Action
[ ] tag "#1"
[-] ButtonMenuItem Configure
[ ] tag "(1:1,1:11)"
[-] ButtonMenuItem LogFlags
[ ] tag "(1:1,2:11)"
[-] ButtonMenuItem OpenLogFile
[ ] tag "(1:1,4:11)"
[-] ButtonMenuItem Connect
[ ] tag "(1:1,5:11)"
[-] ButtonMenuItem Messages
[ ] tag "(1:1,7:11)"
[-] ButtonMenuItem Refresh
[ ] tag "(1:1,9:11)"
[-] ButtonMenuItem Help
[ ] tag "(1:1,11:11)"
</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">So Now when I call Action.Help.Pick(), it correctly picks the menu item.
The tag definition used is in a column row format. So for example, the tag for the Help menu item is 1:1,11:11. this is interpreted as the menu item being in the 1st of 1 total columns and in the 11th row of a possible total of 11 rows. So you need to think of the menu items as being in a grid. Hope this makes sense.
Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.