Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

When I record a new locator for an object map via the object map button ‘Record New Entry’ I receive the error “Unable to add new entry: Root node does not match”

When I record a new locator for an object map via the object map button ‘Record New Entry’ I receive the error “Unable to add new entry: Root node does not match”

The error “Unable to add new entry: Root node does not match” is displayed when the root node for the pasted object does not match the root node in the object map.


Typically this issue can be seen in instances where an object being captured with the ‘Record New Entry’ button retains the full locator path and has not been edited to retain the hierarchy mode in the object map.

As an example if I manually record items into an object map against Notepad, you may see the below hierarchy:

If I now record a new entry for the ‘Save As’ dialog from Notepad by clicking the ‘Record new Entry’ button. The Identify object tool appears and I can select  the ‘Save As’ dialog by clicking on, the locator for the object is identified as ‘/Window[@caption='Untitled  - Notepad']//Dialog[@caption='Save As']’ as seen below:

If we were to click the paste button, we will be met with the error ‘Unable to add new entry: Root node does not match’. 

As a root node for the object map already exists as ‘/Window[@caption='Untitled - Notepad']’,  If the paste was successful we would have a combined locator of ‘/Window[@caption='Untitled - Notepad'] /Window[@caption='Untitled  - Notepad']//Dialog[@caption='Save As']’

To resolve this issue we can edit the locator in the Identify Object tool by removing the parent locator /Window[@caption='Untitled - Notepad'] as this entry already exists in the object map.  The remaining locator in the identify object tool should now resemble the following //Dialog[@caption='Save As']


If we click paste in the identify object tool now we should now have successfully recorded a new entry in the object map, similar to below:

The object has now been successfully added to the object map and will be identified correctly in scripts that use the locator / item name.

 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2016-05-13 18:23
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.