Forum Discussion

panka152's avatar
panka152
Contributor
14 years ago

How to get child items of toolbar window.

I am testing a desktop application where a Toolbar contains 6 different menu icons, I have tried to map the 6 items in it, but I couldn't. Can any one help to achieve this. [Name of the mapped object is: Window("ToolbarWindow32", "", 4) ]



Steps I have performed:

1. Map the toolbar to object browser window using object properties window

2. Mapped the toolbar to name mapping file

3. Right click on the 'ToolbarWindow32' to map its child object......but nothing is shown in 'Selects object to Map' window.



Please guide me if anything I am missing.
  • Hi,


    The Select object to Map dialog does not show any objects, because your toolbar object does not have child objects.


    To work with toolbar items in tests, you do not need to map individual objects, you can use methods and properties of the Win32ToolBar object that corresponds to the toolbar.

  • Hi ,



    Thanks for your kind help.....still I could not do it successfully, need more support from you.



    The current script which works :

    set ToolBar= p.find("Name","Window(ToolbarWindow32, "", 4)",10)

    Toolbar.clickitem(11)



    Problem with this script is I have to first find the index of the Push button [All are image buttons, and image have tooltip] and then execute the script....is  there any way, where I can call the push buttons with text or tooltip?
  • Hi,


    The ClickItem method lets you specify the needed toolbar item not only by its index, but also using its caption or position on the control. Please see a description of the method.

  • Thanks a lot.....

    I used TestComplete wImage function to get an Image of push button its position ,which solves the purpose.