Forum Discussion

Natasha_2012's avatar
Natasha_2012
Contributor
9 years ago

how to find all children of a test object regardless of its property names and values

I have a window object, i want to grasp all of its objects inside that window object, regardless of the its property name and values.  Could you please help me show me how.  The FindAll and findAllOb...
  • osaid_ahmad's avatar
    9 years ago

    You can capture the object whose child objects are required.

    Later ChildCount property could be used to get the count and Child (Index) to iterate through the children.

     

    Consider the following VBScript snippet:

    Dim iChildCount,arrChildObj
    
    Set objParent = page.find(arrProp,arrValue,Depth)     'get the parent Object
    iChildCount = objParent.ChildCount                          ' no of child object
    
    For i = 0 To iChildCount
      Set arrChildObj(i) = objParent.Child(i)
    Next