Forum Discussion

aweigel25's avatar
aweigel25
New Contributor
14 years ago

Accessing methods of Child Objects

I have a window that is used as a template for many windows in my application I'm testing.  This window has a panel that is filled in with the elements that make up that window.  The name of each loaded panel is different but is always the only child of the parent.  I am able to access the Child panel and its items but I am not able to execute any methods from the child object. 



able to access the child and its children




Aliases["ApplicationLauncher"]["MainMenu"]["WindowPanel"]["Child"](0)["toolStrip"] 



I am able to get the toolstrip and access all proprties of the toolStrip but I am unable to clink on any items in the toolstrip.


["ApplicationLauncher"]["MainMenu"]["WindowPanel"]["Child"](0)["toolStrip"]  I am able to get the toolstrip and access all proprties of the toolStrip but I am unable to clink on any items in the toolstrip.  Not working:  Aliases["ApplicationLauncher"]["MainMenu"]["WindowPanel"]["Child"](0)["toolStrip"]["ClickItem"](1)

  Working:        Aliases["ApplicationLauncher"]["MainMenu"]["WindowPanel"]["EmployeeMaintenance"]["toolStrip"]["ClickItem"](1)



  using the line wihth the child item to click item 1 in the toolstrip generates an error message sating the the object does not support the method or property.  Yet in the object browser I can see that it is listed as an valid method and works when the Child name is specified directly. 




1 Reply


  • Hi Alex,





    A possible cause of such behavior is that the object returned by the Child method is not the same as the named Alias item. The point is that some levels of hierarchy can be omited in Aliases, while the Child method work with the original objects tree available in the Object Browser, not with the Aliases tree. To check whether this assumption is correct, post the value of the FullName property of the two objects in a row, like this:



    Log.Message(Aliases["ApplicationLauncher"]["MainMenu"]["WindowPanel"]["Child"](0)["FullName"])

    Log.Message(Aliases["ApplicationLauncher"]["MainMenu"]["WindowPanel"]["EmployeeMaintenance"]["FullName"]);