0 Shares 1442 Views 1 Comments

Most useful function in Test Complete – FindAllChildren

May 31, 2013
1442 Views 1

Fn“Knowledge is Power” famously pronounced by Francis Bacon in 16th century. This is true even today and in Test Complete as well; as more knowledge you have, the better for you. I am going to start a series which would cover the most useful functions in Test Complete.

FindAllChildren is one of the important and useful functions provided by Test Complete developers. This function can help to collect object information that are related. This can also help to minimize lot of objects (Name Mapped items) to be created. I will show you with a scenario that this is a way to drill the development reusable.

Consider an application where the developer has played a lot with panels, customizing the same and using it over and over. Let us imagine that the application is of three vertical panes, one as input, other as output and the middle one being the unit passes through. This can be imagined as a mapping of these and drawing the relationships, however the idea is to stress on the set up and not on the functionality.

SampleApplication

Focusing on the set up, each pane has multiple panels that look similar with different names, actually objects with provision of other actions (let us consider item 1/unit 1 etc as name object). Also take into consideration that there is no limit to the items in each pane, it may grow or reduce or might be replaced ; it is not advisable to map these objects. Here the problem is to crack: How are you going to operate on each name object? The answer is FindAllChildren.

 

In the code above, a dictionary object is created. The container (input/unit/output) is passed through when the function is called. Based on that using FindAllChildren/FindChild the container object is obtained and stored (named objTray). Now applying the FindAllChildren in objTray object based on the criteria required, there would be a list of items as the name objects. FindAllChildren returns an array of objects, looping them and adding them to the collection will help to reuse, count etc. Thus the designed function GetNameObjects collects the name objects then the required items can be filtered to work on the desired.

Syntax

 TestObj is the object from where the child items are to be searched, the parameters  PropNames and PropValues are the array of property names and its value respectively based on which the search is to be performed. Depth is the level of hierarchy until where the search needs to be performed. Shorter the depth faster the response of the search. Refresh by default is true which refreshes the cached objects. For more information on the function details, refer to Smart Bear online help; while in this article I focus where and how useful this function can help in test automation.

Therefore the FindAllChildren function is handy when it is non realistic to build mapped objects at dynamic times and obviously this proves to be better off in those times. The use of this function can be compared to be the descriptive mode with respect to QTP style of handling the similar situation. For more information on the Test Complete descriptive way read further to object-identification-in-testcomplete-descriptive-way

Happy Coding!!

You may be interested

Setting up Web Service Automation Project
Katalon Studio
481 views
Katalon Studio
481 views

Setting up Web Service Automation Project

Saket - Oct 24, 2017

Web services are specific services that can be published and called over the Internet by client applications. Katalon Studio supports functional testing of web services. This topic…

Setting up Mobile Automation Project in MacOS
Katalon Studio
537 views1
Katalon Studio
537 views1

Setting up Mobile Automation Project in MacOS

Saket - Oct 09, 2017

Using Katalon Studio, mobile tester can design automation test for both Android and iOS to run on physical devices, cloud services and emulators. This tutorial explains how…

UFT Jenkins Integration
Unified Functional Testing
1642 views
Unified Functional Testing
1642 views

UFT Jenkins Integration

Saket - Oct 03, 2017

In our earlier post, we got to know the easy integration of UFT with GIT. This post focuses on integration of UFT and Jenkins. I have also…

One Comment

  1. Pingback: TestComplete 12 has been released - Automated-360

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...