Forum Discussion

ashishnagpal26's avatar
8 years ago

Can someone please explain me the below FindChild method.

Hi can anyone please explain how does this work .   Aliases.PM.PopupWindow.FindChild(Array("ClrClassName","ToolTip"), Array("Button",KeywordTests.ClickButtonOnWindow.Parameters.ButtonName), 50, Tru...
  • AlexKaras's avatar
    8 years ago

    Hi Ashish,


    Something like this:

    -- TestComplete checks if  both PM and PopupWindow objects can be found in the tested application's objects tree according to their search criteria defined in the NameMapping (Aliases.PM.PopupWindow). An error is posted to the test log if any of the sought for object is not found;

    -- TestComplete gets the keyword test named ClickButtonOnWindow (KeywordTests.ClickButtonOnWindow), gets list of its parameters and gets the value of the ButtonName one (KeywordTests.ClickButtonOnWindow.Parameters.ButtonName);

    -- Finally, using the PopupWindow as an initial search root, TestComplete searches down through the list of PopupWindow's child objects and tries to find an object whos "ClrClassName" and "ToolTip" property values are equal to "Button" and the value of the ButtonName parameter correspondingly (.FindChild(Array("ClrClassName","ToolTip"), Array("Button",KeywordTests.ClickButtonOnWindow.Parameters.ButtonName) ... ). Search depth is not more than 50 levels down (.FindChild(..., 50) ). The found object is returned as a search result. An empty stub object that contains the only Exists property set to False is returned if no object is found during the search.


    Does this help ?