Map a test object class to application controls
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 One 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 One to identify the test object class to use for a custom Web control in the UFT One Web Add-in Extensibility Developer Guide.
Note: This task is part of a higher-level task. For details, see Create or update support for a single control.
Prerequisites
Plan your support.
For details, see the section on planning UFT One support for your toolkit in the UFT One 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.)
Create a tab for a browser-specific rule set - Optional
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 One 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.
Expand the panel for the type of rules you want to create
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 One ignores the set of Ignore Control rules when attempting to identify the control.
For more details on how UFT One uses the different types of rules, see the section on teaching UFT One to identify the test object class to use for a custom Web control in the UFT One Web Add-in Extensibility Developer Guide.
Create a set of mapping rules automatically
Perform this step separately in each relevant Rule Creation panel and within each relevant browser-specific tab.
For details, see Create a set of mapping rules automatically .
Edit mapping rules manually - Optional
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.
For information on the options in the rule editor, see the Rule Editor Area section in Map to Controls tab (Test Object Class designer).
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.
Test and update your mapping rules
Test your mapping rules on an application and update them if necessary.
You can test the rules in each panel separately, and test all of the rules together.
Follow one of the procedures described below:
To test one set of rules without modifying:
|
To test one set of rules and update them if necessary:
|
To test all of the rules together: 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. For example, if you have a Default Rules tab, and a Chrome tab, the default rules are applied to any open Internet Explorer windows, the Chrome rules are applied to any open Chrome browser. 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. |
See also How Extensibility Accelerator tests your control mapping.