Edit Name Mapping Item Dialog - Selectors

Applies to TestComplete 15.63, last modified on April 23, 2024

In the Edit Name Mapping Item dialog, you can modify an object’s mapping criteria. These mapping criteria are specified as a combination of selectors.

Web (Cross-Platform)

Edit Name Mapping Item dialog - Selectors mode

Mobile

Edit Name Mapping Item dialog - Selectors mode

For web objects, a selector can be an XPath expression or a CSS selector. They must comply with the following:

For mobile objects, a selector can be an object identifier, a class name, or an XPath expression.

To call the dialog

In the Name Mapping editor, double-click the object in the Mapped Objects tree or its alias in the Aliases tree.

– or –

Right-click the object’s mapped name or alias and then click Edit.

As an alternative, you can edit the object’s mapping criteria directly in the Name Mapping editor.

To change a mapped object name

Enter the desired name in the Mapped Name text box. The name can contain only letters (A..Z, a..z), digits (0..9), and underscore characters ( _ ) and must start with a letter. The mapped object names are case-insensitive.

To change an object description

Enter a description for a mapped object in the Description text box.

To add a selector to the criteria

  1. Click Add.

  2. For web objects, in the drop-down list, select the selector type: an XPath expression or a CSS selector.

    For mobile objects, leave the default XPath type.

  3. Enter an expression to use to locate the object. The dialog will validate the expression. The Annotation section will show a brief description of the selector. If the specified expression is not valid, the Annotation section will show a notification about it.

To modify the criteria

Click the selector in the list and type a new expression.

To use variables in expressions or selectors

Replace a selector or the part of it with the project variable name, in the following format: %var_name%. If the specified variable does not exist in your project, your test will report an error.

To delete a selector

To delete a selector, select it and click Remove.

To enable or disable a selector

Select or clear the check box next to the selector you want to include to the criteria or exclude from it.

To change the selector priority

When trying to locate a tested web object, the test engine checks the selectors that the criteria specifies in the order they are listed by the editor.

Select a selector whose priority you want to change and click Move Up or Move Down respectively.

To save or cancel the changes

To close the dialog and save the changes you have made to the object’s mapping criteria and other properties, click OK.

To close the dialog discarding any changes, click Cancel.

See Also

Edit Name Mapping Item Dialog
Name Mapping
Name Mapping - Selectors

Highlight search results