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.
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
In the added row, enter a new selector. For a web object, it can be either an XPath expression or a CSS selector. For a mobile object, it can be the object’s identifier, its class name, or an XPath expression.
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.