Open topic with navigation
This task describes how to define and test the mapping rules for a test object class. The mapping rules indicate the types of controls for which UFT should use the test object class. You can create different rules to support different browser versions.
For more details on mapping rules, see the section on teaching UFT to identify the test object class to use for a custom Web control in the Micro Focus UFT Web Add-in Extensibility Developer Guide.
Note: This task is part of a higher-level task. For details, see How to Create or Update Support for a Single Control.
Plan your support.
For details, see the section on planning UFT support for your toolkit in the Micro Focus UFT Web Add-in Extensibility Developer Guide.
Open an application that contains the relevant controls.
With an Extensibility Accelerator project open, run one or more applications that contain the controls you want to support. Make sure that the page is fully loaded and the relevant controls are visible. (You must run Extensibility Accelerator and open a project before you open the Web browsers.)
In the Map to Controls Tab (Test Object Class Designer), if you create mapping rules only in the Default Rules tab, these rules are used to map your controls to a test object class, for all browsers you work with.
If you want UFT to use different mapping rules when working with your controls in different browser versions, click the Add Browser-Specific Rules to add tabs for additional sets of rules. The Add Browser Dialog Box opens, enabling you to specify the browser details.
Perform the next steps in each tab to create the necessary set of rules in each one.
In the Map to Controls Tab (Test Object Class Designer), select the Default Rules tab, or a browser-specific tab.
Select the type of rules you want to create, and expand the relevant panel.
Available types: Identify Control, Call Identification Function, Ignore Control.
If you want to create more than one type of rules, perform the next steps in each relevant panel.
Note: If you create a set of Call Identification Function rules and a set of Ignore Control rules, UFT ignores the set of Ignore Control rules when attempting to identify the control.
For more details on how UFT uses the different types of rules, see the section on teaching UFT to identify the test object class to use for a custom Web control in the Micro Focus UFT Web Add-in Extensibility Developer Guide.
Perform this step separately in each relevant Rule Creation Panel and within each relevant browser-specific tab.
For details, see How to Create a Set of Mapping Rules Automatically .
In the Rule Editor Area (in each rule creation panel and within each relevant browser-specific tab in the Map to Controls tab), you can make manual changes to the automatically created rules, or create your own rules.
For example, you can:
Add and delete rules.
Change the order or logic of rules.
Generalize rules by defining regular expressions for property values.
Modify automatically created regular expressions to make them more accurate.
The rules are stored in the relevant Identification element in the toolkit configuration XML file, in Conditions elements.
Tip: You can improve performance by limiting the identification process of custom controls to HTML elements with HTML tags you specify. However, you must do this manually in the toolkit configuration file, and the definitions that you add will not be displayed in Extensibility Accelerator. For details, see the section on the HTMLTags element in the Toolkit Configuration Schema.
You can test the rules in each panel separately, and test all of the rules together.
Follow one of the procedures described below:
Click Test All Rules.
All of the controls that match the mapping rules in all open Web applications, are highlighted.
The rules from each tab are applied to the corresponding open browsers.
In addition, when the defined rules warrant it, the identification function that you implemented is also called to assist in identification of the relevant controls. For example, the identification function is called if a control's properties meet the rules defined in a set of Call Identification Function rules, or if no rules are defined at all.