Ask a Question

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

SOLVED
Natasha_2012
Contributor

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 findAllObjects require the property names and values

 

 

3 REPLIES 3
osaid_ahmad
Contributor

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

 

Thanks heaps for this.

Presume you could also use "FindAllChildren" as normal as well.

 

Except use "Id" as your property (as all objects have an Id don't they?), "*" as the property value (so it'll find everything) and a depth of 1 (to only get direct children of the parent).

 

You could also modify this to exclude hidden objects by expanding the search parameter arrays.

cancel
Showing results for 
Search instead for 
Did you mean: