Hi Stuart,
The Flat or Tree model set via the project's
General > Object tree model option only affects the object hierarchy of desktop applications, such as Notepad or Paint. The
object hierarchy of web pages is set via the project's
Open Applications > Web Testing > Tree model option. (I'd like to note that in TestComplete 9, all web object models but Tree are legacy and not recommended for use.)
Now, to your question. Name Mapping has a feature called Extended Find that lets you avoid mapping intermediate objects and associate the target object with any parent further up the hierarchy. For details, please see the
Using Extended Search Criteria for Mapped Object Identification article.
Alternatively, you can design your tests to dynamically locate web objects using the
FindChild,
Page.NativeWebObject.Find or
Page.EvaluateXPath method. See
Finding Object on Web Pages for more information.
In addition to that, I'd highly recommend watching our webinar on the subject:
Creating Reliable Tests For Dynamic Objects with Name Mapping