Hi,
> The client wants us to only use name mapping for all check but we think xpath is an easier alternative :-)
Generally speaking, I am with your client.
While it may depend on the given tested application, Aliasing is usually a much better approach when compared to XPath.
Something that might affect your code:
-- If XPath finds the sought for object, then either TestComplete's wrapping object or native DOM object may be returned. Native DOM object does not have .Exists property (and others, provided by TestComplete). So you will have to either figure out what object was returned as a result of the search, or use only native DOM properties in your test code.
-- If XPath does not find the sought for object, then null is returned. Which means that you cannot use object.Exists approach that is native for TestComplete.
> We are looking to get the ContentText of the objects
Again, if the native DOM object is returned as a result of XPath search, then this object will not have .ContentText property as it is provided by TestComplete:
https://support.smartbear.com/testcomplete/docs/app-testing/web/general/cross-browser/creating.html#cross-browser-testing-tips