Hi,
TestAdvantage ver 2010.3,
Following code is not working
'Get the list of items in the toolbar tlbContent = SwfWindow("Microsoft TaskVision 1.1").SwfToolBar("tbrTop").GetContent
'no. of Items in toolbar
cItems = SwfWindow("Form1").SwfToolBar("Formatting").GetItemsCountSwfWindow("Form1").SwfToolBar("Formatting").GetItem(index)
Also not able to find out one of the toolbar button ENABLED or DISABLED property value with GetItemProperty.
As Button click Record-Playback code gives this for Toolbar
PerformToolAction tbmgrToolbar, tbmgrClick,tblbarname , btnName
There should be equivalent code for operations - GetItem(), GetItemsCount, GetContent, GetItemProperty
Pl advice on this.
Thanks,
~Laxmikant.
Laxmikant,
Here is an example of script that you can use with the methods that you mentioned. You can run this script against the WinToolbarsBasicFeatures sample found in the samples that are installed with TestAdvantage.
'Example of GetItem methodDim openItemopenItem = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItem("Editors", 1)MSGBOX("GetItem: " & openItem) 'Example of GetItemsCount methodDim editorItemsCounteditorItemsCount = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemsCount("Editors")MSGBOX("GetItemsCount: " & editorItemsCount) 'Example of GetContent methodDim editorContenteditorContent = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetContent("Editors")MSGBOX("GetContent: " & vbCrLf & editorContent) 'Example of GetItemPropertyDim editorItemPropertyeditorItemProperty = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemProperty("Editors", 1, "Enabled")MSGBOX("GetItemProperty: " & editorItemProperty)
'Example of GetItem methodDim openItemopenItem = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItem("Editors", 1)MSGBOX("GetItem: " & openItem)
'Example of GetItemsCount methodDim editorItemsCounteditorItemsCount = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemsCount("Editors")MSGBOX("GetItemsCount: " & editorItemsCount)
'Example of GetContent methodDim editorContenteditorContent = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetContent("Editors")MSGBOX("GetContent: " & vbCrLf & editorContent)
'Example of GetItemPropertyDim editorItemPropertyeditorItemProperty = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemProperty("Editors", 1, "Enabled")MSGBOX("GetItemProperty: " & editorItemProperty)
I hope you find this helpful. Let me know if you have further questions.
Michael S.
Was the sample script helpful? Let me know if I can be of further assistance.
Thanks for your valuable support. There are no more question on this.
I am able to get the item from toolbar. How to select that item? which item property needs to be used?
You have passed toolbar as "Editors"...What is that???
What needs to passed at that position???
"Editors" should be the key of the taskpane toolbar.
Hello all,
Could you please clarify, how can I use GatContent method to the child menue item?
Please, refer below:
Ravi,
I answered your question here.
Hi Michael,
I'm not able to find the valid key from the toolbar, could you please help me out with it.
SwfWindow("window").SwfWindow("window").SwfObject("_TempBlotter_Toolbars_Dock_Ar").GetItemsCount("Refresh")...this throws an error saying "key not found".
I'm using TestAdvantage 2006 CLR 2.X version 3....
Regards,
Ravi Salunkhe
The GetContent method takes a string for the key or a number for the index of a toolbar and returns the captions of the tools within the toolbar in a list that is delimited by a new line. You seem to want to access a tool on a child menu which is a popupmenutool and not a toolbar, so I don't think the GetContent method will work for you. Please tell me exactly what you want to do with the child menu so that I can address your question.