Control: Infragistics2.Win.UltraWinToolbars (SwfToolBar)Version: TestAdvantage 7.1.20071.40QTP 9.2 with .NET and WEB add-in
Our AUT has a Toolbar Ribbon that contains Tabs[.Groups[.Tools[. I need the ability to loop through the Members of each Collection. Typically, I use GetNAProperty to obtain a count of the Members of the Collection, so I know when to terminate the loop. However, I cannot locate a property in these Collections that contains a count. Is there a method or a process that will return a count of the Members of a Collection, or perhaps another way to terminate the loop before exceeding the index range? Thank you.
Some additional information: I have since tried the following...
Dim objTabs, objItemSet objTabs = .SwfToolbar("_Toolbars_Dock_Area_Top").GetNAProperty ("Ribbon.Tabs")Set objItem = CreateObject(objTabs)For each objItem in objTabs MsgBox "Collection Test", vbInformation, "Test"Next
I receive the following Run Error at the CreateObject line: ActiveX component can't create object: 'Infragistics.Win.UltraWinToolbars.RibbonTabCollection'
Any ideas?
To get the number of tabs in the ribbon you can use
TabsCount = .SwfToolbar("_Toolbars_Dock_Area_Top").GetNAProperty ("Ribbon.Tabs.Count")
and to get the number of groups in a specific tab (say the first tab)GroupsCount = .SwfToolbar("_Toolbars_Dock_Area_Top").GetNAProperty ("Ribbon.Tabs[0].Groups.Count")
To get the number of tools in a specific group (say the group of the first tab)GroupsCount = .SwfToolbar("_Toolbars_Dock_Area_Top").GetNAProperty ("Ribbon.Tabs[0].Groups[0].Tools.Count")
I hope that will help
Regards,
Ammar
Ammar,
I tried use in QTP 9.5 GetNAProperty ("Ribbon.Tabs.Count") , ClickRibbonTool (ribbonTab,tool) ... and got msg:
property value for Ribbon throws the following exception:Invalid Property name: Property Ribbon not found
Line (4): "Tabs = SwfWindow("AAAAA").SwfToolbar("Dock_Area").GetNAProperty ("Ribbon.Tabs")".
Please help me.
You can try the following script
Tabs = SwfWindow("AAAAA").SwfToolbar("Dock_Area").GetNAProperty("Ribbon.Tabs[0].Group[0].Tools[0]")
This will give you the number of toolbar items in that particular group.
My problem is how to check the state of the toolbar item. How to check whether its enabled or disabled. I need this to validation.
Can anyone assist me in this?
Regards. Tinu