Forum Discussion
Hi Megha,
As far as I can see, the images display different objects. The Object Browser image shows a top-level window which is not mapped (its MappedName is empty). The Mapped Objects image shows a mapped button (not a top-level window). So, now I tend to think that either your application has changed, or the mapping settings do not correspond to actual property values.
Also If Test complete does not store the Objects then , how it run the same if we save and play the script ? I mean how it identify the object properties ?
Each process, window or control that exists in the operating system has a number of properties. Some of these properties may change from one application build to another (for instance, screen coordinates) or even from one application run to another run. Some other properties are quite persistent (for instance, the control name specified in the application source code).
As you can see in the Object Browser, quite often, an object name is a combination of several values, for instance, Window("IME", "Default IME", 2). These parts are values of certain properties that are typically persistent (that is, do not change often) and can be used to identify an object. So, during the test run, TestComplete searches for the object, whose property values match the values specified in the object name. That is, in your test, you can work with any object, not just with those you added to some kind of "repository".
However, quite often, these names are quite long, or properties used for identification are not persistent. In such cases, you can define shorter, readable, human-friendly names for the objects and also redefine the set of identification properties (if needed). This is similar to QTP Object Repository. We call this Name Mapping. TestComplete maps object names automatically during the test recording. That is why, you see shorter names in tests and long names in the Object Browser.
When an object is mapped, TestComplete searches for it using the identification properties specified by the name mapping settings.
These are properties you can set for an object in the Name Mapping editor. The editor has the Mapped Objects tree and the Aliases tree.
What Aliases. Drag Mapped object here do ?
When an object name is mapped (either by you, or by TestComplete), TestComplete maps the object and all its parent objects. The mapped hierarchy is shown in the Mapped Objects tree. What do you need this tree for? The fact is that the search takes some time and mapping the parent objects narrows the amount of objects to be checked. For example, searching for a window among all the windows existing in the operating system will take much longer if you first search for the needed process and then for the needed window in this process.
The hierarchy of mapped objects can be deep (that is, it may include many levels), which can make addressing objects inconvenient. In this case, you can create an Alias for an object. An alias lets you skip some mapping items in tests and use a shorter notation. For example, instead of NameMapping.MyProcess.MyForm.HelperPanel1.HelperPanel2.HelperPanel3.HelperPanelN.MyButton, you can just use Aliases.MyProcess.MyForm.MyButton.
An alias links to the name mapping item, for which it was created, that is,
Alias (if it is used) ->
Name mapping item ->
Underlying object in the application
Also when I Right click on some of Object from Mapped Object > It show error ' Unable to highlight the object ..... as Underline object doe not exist.
This error indicates that the object, to which an alias or mapping item refers, does not exist. Please ensure the application is launched, the form that contains the object is visible, the object exists on it, and so on. If the error still occurs, please check the mapping settings in the Mapped Objects section of the Name Mapping editor. Perhaps, the settings do not match the actual property values.
How to map the Object ? Will you please explain as it is difficult to undertsant it from the Smart bear Articles ?
This is done automatically during the test recording. You can also do this manually: find the needed object in the Object Explorer, right-click it there, select Map Objects and then follow the instructions of the subsequent wizard. Also, you can click the "Map Object From Screen" button on the TestComplete toolbar and select the object on the screen and then follow the wizard instructions.
Related Content
- 5 years ago
- 12 years ago
- 9 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago