I have a Tabgroup and QTP reads it as SwfWindow("X").SwfTab("SwfTab"). At a time, more than one tab can be opened. I want to retrieve a property specific to a tab. that means my code should be able to read the properties of individual tabs.
I tried SwfWindow("X").SwfTab("SwfTab").GetNAProperty("TabGroup.Tabs[0].Settings.AllowClose").
Here Tab[0] is the first Tab for that I am trying to retrieve Settings.AllowClose property. but it gives the error with the message "IG : Getting property value for [TabGroup] throws the following exception: IG : Invalid Property name: Property [TabGroup] not found". but here I verified that TabGroup is a valid property of Tabs. I also tried SwfWindow("X").SwfTab("SwfTab").GetNAProperty("TabGroup.Tabs[0].Settings[0].AllowClose") but for no use.
I tried by creating tab object and the following code explains that:
Set mdiTabObject = SwfWindow("X").SwfTab("SwfTab").Object
getAllowCloseproperty = mdiTabObject.TabGroup.Tabs[0].Settings.AllowClose. This also did not worked.
but I am able to get the count of Tabs TabCount = mdiTabObject.TabGroup.Tabs.Count. This works.
I appreciate If I get some help in retieving individual Tabs properties.
Thanks
Hello Vidya,
In most cases you can follow the following basic steps, you can look at the objects SwfTypeName in the Object Repository or ObjectSpy, and from that type name you can look up members through help.infragistics.com and pull up the API docs of that class. Which appears in some manner that is what you did. The problem lies in the following few classes in which GetNAProperty use the indented root object as a basis instead of the SourceControl as they are what are dropped on the form by a developer: Infragistics.Win.UltraWinDock.DockableWindow Infragistics.Win.UltraWinDock.UnpinnedTabArea Infragistics.Win.UltraWinDock.WindowDockingArea Infragistics.Win.UltraWinDock.UltraDockManager Infragistics.Win.Misc.UltraDesktopAlertWindow Infragistics.Win.Misc.UltraDesktopAlert Infragistics.Win.UltraWinTabbedMdi.MdiTabGroupControl Infragistics.Win.UltraWinTabbedMdi.UltraTabbedMdiManager Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea Infragistics.Win.UltraWinToolbars.UltraToolbarsManager
Using that as a guide then, in this case the object that you are getting properties off of is the UltraTabbedMdiManager, and not the MdiTabGroupControl. In which case there is no TabGroup property, but there is a TabGroups indexed property, which you should be able to use : SwfWindow("X").SwfTab("SwfTab").GetNAProperty("TabGroups[0].Tabs[0].Settings.AllowClose")
As to the reason with the .Object did not work, that is handled by QuickTest Professional, and uses the SourceControl as a base which is MdiTabControl. The issue is they do not handle indexed properties as well. Although in this case, as with most indexed properties you can use GetItem(intIndex) to get the value. So something like the following should work: SwfWindow("X").SwfTab("SwfTab").Object.TabGroup.Tabs.GetItem(0).Settings.AllowClose