Hi, I'm having difficulties to understand how the NameMapping works. When adding an object to the name mapping i can the see that it asks for the properties i want to add to this specific object...
NameMapping consists of two parts... first, the mapping which is the object recognition settings to determine, based upon properties and object hierarchy, the identification of objects. So, for example, using the website http://secure.smartbearsoftware.com/samples/TestComplete10/WebOrders/, the username text field could be mapped as
The properties for each level in that string tell test complete how to identify the specific object. So, for the username text box, I have it mapped using the properties of ObjectType and ObjectIdentifier with values of Textbox and username respectively. This allows TestComplete, without having to write lines of code to "find" components, to use the above string to identify the object.
However, that string can get to be cumbersome for more complex websites. There may be additional DIV panels and tables with cells with more div panels, etc. So, mapping a single text box could generate a VERY long string. This is where Aliases, the second part, comes in. While I could have an Alias that looks like this:
That's a pain in the butt to utilize. There are two objects in the mapped hierarchy that, for practical purposes in the test, are unnecessary. So, I "drag" the textboxusername in the Aliases to be a direct child of pageWebOrdersLogin and remove the unnecessary Aliases. So, now my Alias is
This is much less cumbersome to work with. When the automation code reads this alias, the NameMapping engine of TestComplete interprets it back to the NameMapping string and identification factors.
So, in short, NameMapping identifies the objects, Aliases translates them into more compact and human-readable strings for use in tests.
Now, as for your question about not highlighting the object... depending upon what object you are trying to highlight, there could be any number of reasons why it won't show on screen. Primary would be that the NameMappping criteria used is insufficient to identify the object and, therefore, won't highlight it. This could happen if there are dynamic factors involved in the identifying properties (cyciling ID numbers, etc). Resolution: Edit the mapping criteria of the object to use more "static" identification factors or wildcard those portions that are seemingly random.
Other reasons for not highlighting would be if you're attempting to highlight an object that is not necessarily a visible or rendered object on screen but is simply a "container" for other objects. Some applications do this.
As for your critical problem, this sounds, again, like a problem with object identification. The factors you are using in your NameMapping for your objects are either not unique enough to distinguish properly between the two different project sets or there are randomizing factors in your identification criteria that are preventing identification.
Another possible factor, not related to NameMapping, is a timing factor. Automated test in TestComplete run faster, many times, than the application can keep up. So, if it takes too long for the objects to render in your application, the test scripts may fail.
As to your concern about editing scripts... that's why NameMapping is so powerful. If you keep your Aliases as they are, you can modify the mapping as much as you want to, including changing hierarchy, adding additional panels in between, altering identification factors, etc. In my above example, so long as my Alias remains the same, I don't ever need to change that value in my tests. I can edit my NameMapping as much as I want for that Alias and the script code will still find the object.