Edit Name Mapping Item Dialog - XPath Expressions and CSS Selectors

Applies to TestComplete 14.80, last modified on May 04, 2021

In the Edit Name Mapping Item dialog, you can modify a web object’s mapping criteria. These mapping criteria are specified as an XPath expression or a CSS selector, or a combination of them via the logical OR operator. To learn more about mapping web objects this way, see XPath Expressions and CSS Selectors.

Edit Name Mapping Item dialog - Mapping objects by their XPath expressions and CSS selectors

XPath expressions and CSS selectors must comply with the XPath syntax and CSS selector syntax respectively. You can learn the details here:

To call the dialog

In the Name Mapping editor, double-click the web object’s mapped name in the Mapped Objects tree or its alias in the Aliases tree.

– or –

Right-click the web 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 an expression or selector to the criteria

  1. Click Add.

  2. In the added row, enter a new XPath expression or a CSS selector.

To modify the criteria

Click the selector in the list and type a new XPath expression or CSS selector.

To use variables in expressions or selectors

Replace the CSS selector or XPath expression 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 XPath expression or CSS 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 XPath expressions and CSS selectors that the criteria specifies in the order they are listed by the editor.

Select the XPath expression or CSS 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
XPath Expressions and CSS Selectors

Highlight search results