Cloned Controls

When integrating applications that create multiple instances of targets with identical type, such as MDI child windows, Studio can create cloned controls to match the targets. To enable cloning controls, set the UseKeys property to True for the highest level control in Object Explorer for which cloning is required. Setting this property to True will enable the Key property for the control so you can specify interactions with specific instances of the control in automation logic.

Note: The UseKeys and Key properties are available on all interrogated controls. However, UseKeys is set to False by default and the Key property value is null.

For example, click here to see the sample CRM application installed in the OpenSpan\Extras folder which creates MDIChild windows each time a New Call or User button is clicked.

When the CRM New Call window is interrogated, these controls are created in Object Explorer:

To indicate that multiple instances of the MDIChild_NewCall window can exist during runtime, the UseKeys property is set to True for the MDIChild_NewCall.

You do not set the UseKeys to True for all of the child controls on the MDIChild window, such as the btnPhone_Information, txttxtCity, and so on.

When the UseKeys property is set to True, Studio creates a cloned control for each instance of the window. Controls having the UseKeys property set to True are denoted with a II icon in Object Explorer:


As you open multiple instances of the target, such as the MDIChild window, multiple matched targets appear in the Targets pane on the Match Rules tab:

The highlighted target corresponds to the target that was initially interrogated – the clone prototype.  The matching states of this control and its child controls are based on the match rules initially applied during interrogation. For more information, see Interrogating Cloneable Targets.


Related information

Interrogating Cloneable Targets

Key Property

Setting or Activating a Key

Identifying Targets on MDI Child Windows

Using the Upstream Key/Override Key

Handle Key Not Found Exception

Methods, Properties, and Events to use with Cloned Controls


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.


OpenSpan data classification label