Forum Discussion

sonali_suhani's avatar
sonali_suhani
Occasional Contributor
12 years ago

handle indexes of an object in vbscript using testcomplete

Hey Guys , I'm Facing issues with the dynamic index values

I have two objects, their full name is as below:





Sys.Process("OpKey").WinFormsObject("Workbench").WinFormsObject("NavAndTabView").WinFormsObject("DockPanelProjectExplorer").WinFormsObject("DockPanel1_Container").WinFormsObject("OpKeyProjectNav").WinFormsObject("NavBarControl1").WinFormsObject("NavBarGroupControlContainerWrapper", "", 1).WinFormsObject("NavBarGroupControlContainer2").WinFormsObject("ORExplorer").WinFormsObject("BarDockControl", "", 5).WinFormsObject("DockedBarControl", "")







Sys.Process("OpKey").WinFormsObject("Workbench").WinFormsObject("NavAndTabView").WinFormsObject("DockPanelProjectExplorer").WinFormsObject("DockPanel1_Container").WinFormsObject("OpKeyProjectNav").WinFormsObject("NavBarControl1").WinFormsObject("NavBarGroupControlContainerWrapper", "", 3).WinFormsObject("NavBarGroupControlContainer3").WinFormsObject("DR_Explorer").WinFormsObject("BarDockControl", "", 5).WinFormsObject("DockedBarControl", "")





I'm attaching the screenshot of my application

actually i have a common dockBarControl which seems common for all the tabs but it has the above properties changing in its name.



now i want to make it work for all of them . these are just two just as the above matter , i want to make this script global for every one so that i don't have tpo strat working again from scratch . please suggest me a way i can do it . Thanks


























  • Hi Sonali,


     


    Actually, the Index property isn't very reliable. Can you find properties whose values aren't changed from run to run that can help you identify the problematic objects? If you can, you'd better use the Find method to obtain objects.