Cloned Controls

When integrating applications that create multiple instances of targets with identical type, such as MDI Child windows, OpenSpan can create cloned controls to match the targets. To enable cloning controls, set the UseKeys property to True for the highest level control in the Object Explorer for which cloning is required.  Setting this property to True will enable the Key property for the control so that 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, the following controls are created in the 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, etc.).

 

When UseKeys is set to True, OpenSpan will create a cloned control for each instance of the window. Controls having the UseKeys property set to True are denoted with a II icon in the 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. See the Interrogating Cloneable Targets topic for information on checking the matching state of other instances of the control.

See also

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