FindChildren

Estimated reading: 5 minutes 1974 views

FindChildren

This activity helps the user to retrieve a collection of child UI elements from the specified element. It is particularly useful for scenarios where the user needs to interact with multiple child elements within a parent UI element, such as extracting data from a table, navigating through a list of items, or performing actions on a set of buttons or input fields.

Properties

INPUT

DelayAfter: It assists the user to add a delay before initiating subsequent activities. The delay duration here is in milliseconds. By default, it is set to “300” milliseconds. When the option is left blank, the delay will not be considered.

DelayBefore: It assists the user in adding a delay before starting the execution of the activities. The delay duration here is in milliseconds. By default, it is set to “200” milliseconds. When the option is left blank, the delay will not be considered.

ExecuteBy:Gets auto filled once the “Active Application” is selected. This contains the set of attributes for the specific spied element.This parameter accepts values in “String” datatype. You can either hardcode the values in “String” format or can enter the values in the “String” datatype.

Scope: This parameter indicates the scope for collecting UI child elements.
Children: It retrieves the collection of immediate child elements from the parent element.
Descendants: It also retrieves the descendants of the parent UI element, including all nested child elements.

WaitTime: It helps the user to add a delay to start the execution of the further activity. The format of the delay here is milliseconds. By default, it will be set to 10000. When the option is left blank, no delay is considered.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized which will help in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”
True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It specifies the version of the web automation feature in use.

OUTPUT

Children: This parameter displays the output of the activity as a collection of UI child elements retrieved from the detected element.
The values returned by this parameter are of the “LIST<UIChildren>” datatype. Please refer to the document below for guidance on declaring the variable.

Result: It provides the ability to view the execution status of the activity. It returns values in “Boolean.”
True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

Represents mandatory fields to execute the workflow

What is referred to as Child & Descendants UI elements?

Child UI Elements: These are the direct elements within a parent element. For example, in a file explorer window (the parent), each file or folder displayed is a child element of that window.
Descendants: These refer to the values or elements nested further inside child elements. For instance, if the child element is a folder, the files or subfolders inside that folder are its descendants.

Hence, child elements are directly within the parent, while descendants go one step deeper, being contained within the child elements.

How to view the output from the activity?

The “FindChildren” activity provides the output in the “List<UIChildren>” format. This list includes the following four types as output:

  1. AutomationName – Provides the “name” of the detected element during the execution of the bot.
  2. AutomationID – It indicates the unique identification for the detected element to identify it and making easier to interact with it. It returns the “AutomationID” as output. When there is no AutomationID, it will be returned as null value.
  3. ClassName – It indicates the “Class” of the detected element and returns the output. When there is no  ClassName available, it will be returned as null value.
  4. UIChildren – It provides the count of the UI child and descendant elements associated with the parent element.

If you want to view any of the above types as output, you need to specify this along with the ‘ForEach’ variable. For example, “Item.AutomationName”.

Tips

1. The “UIchildren” output is used to view the number of child and descendants’ elements associated with parent element.
2. If you need to view the output as “UIChildren”, please choose the “Scope” as “Descendants” in the “FindChildren” properties. Since, it is used to retrieve all the child and its descendant’s count as output.
3. To view the output as “UIChildren”, you need to mention the value as “Item.UIchildren.Count.ToString”.
4. If the values of the above fields contain special XML entity characters, they need to be replaced and assigned before executing the activity.

5. For example, if the detected element contains “&” symbol in the name, replace the value as “Replace(“&”,”&amp”) along with the variable name.

Share this Doc

FindChildren

Or copy link

CONTENTS