Ask a Question

FindAll method

Occasional Contributor

FindAll method

I'm using TestLeft and I'd like to find all the children of a particular object which match a pattern. I can't see a way of doing this, if I use Find<> it only returns one object and if I just use object.Children, I can't filter it with a pattern.

Is there a way to do this?


Hello wilkinc,


It seems that Testleft does not support this method yet but since you've found the container of the child objects that you are looking for, you could implement something like this.


suppose you have your containter called myContainer.


Class_of_the_child myChildObject = null;




    myChildObject = myContainer.Find<Class_of_the_child >(new YOUR_TECHNOLOGY_PATTERN()


      my_search_criteria1 = search_criteria_param1,

      my_search_criteria2 = search_criteria_param2



  //Do whatever error handling you wish. There is no need, the Find method returns null the the object is not found.


  //Do whatever you want with the child. You may put them all into an array if you wish

while (myChildObject != null)


Best regards,


Leandro de Araújo Souza

Community Hero



In addition to the previous reply, I would suggest to ask for this functionality:

  /Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
New Contributor

As a workaround CallMethod of IObject class might be used. Here is an example:


        internal List<ICheckBox> MenuItems
        { get { return NavigationTargetsContainer.CallMethod<IEnumerable<object>>("FindAll", "ClrFullClassName", "System.Windows.Controls.CheckBox", 5)
                                                                                    .Select(obj => ((IObject)obj).Cast<ICheckBox>()).ToList(); } }

  But I totally agree, the special signature of FindAll method is absolutely necessary.

SmartBear Alumni (Retired)

Hi all,


FindAll is now available in TestLeft 2.0.

Helen Kosova
SmartBear Documentation Team Lead
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Showing results for 
Search instead for 
Did you mean: