IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
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.