Identify Java Toolbar buttons dynamically
I'm wondering if anyone has been able to dynamically identify JavaToolbar buttons?
In my AUT, the Toolbar buttons do not have captions only icons and depending on the build the WindowID and Index will change.
Is there some way to maybe use the icon name to identify the button index or window id?
Re: Identify Java Toolbar buttons dynamically
Hey i found a document that goes as follows.See if it helps:
A toolbar where SilkTest sees only a single object Toolbars are often seen by SilkTest as a single object. The individual tools are not distinguished, but are instead part of the rectangle of the toolbar itself. It is easy to create sub-objects for each of the toolbar buttons using the window tag syntax: tag (col : ncols, row : nrows). Using the tool palette in Paint as an example:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> AfxWnd42 ToolBar
VOID Select (STRING sTool)
tag (2:2,2:20)</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">The only window that SilkTest recognizes in this example is the AfxWin42. The tools are created by imposing an imaginary grid on the ToolBar with the custom tag syntax. The first tool, FreeFormSelect, is the sub-object in column 1 of 2 columns and row 1 of 20 rows. Note in the code example above that a Select method is included making it very easy to pick a tool from the toolbar. Because the imaginary grid is superimposed at runtime, this strategy for selecting tools is robust and works across different machine resolutions.