TestComplete Tutorial 19 - Adding Objects to the Name Mapping Repository
You can add objects to the Name Mapping repository in several ways:
Automatically when recording and editing tests.
Manually from the screen or from the Object Browser.
From scripts.
Record tests,
Create checkpoints,
Add or edit keyword test operations.
This behavior is controlled by the Engines > Name Mapping > Map object names automatically option of TestComplete:
If you do not use the Name Mapping repository in your project, you can disable this option to prevent TestComplete from mapping objects.
To enable or disable automatic name mapping
Select Tools > Options from the TestComplete main menu. This will open the Options dialog.
Select the Engines > Name Mapping category.
Select or clear the Map object names automatically check box.
Click OK to save the changes.
Mapping objects automatically during the test recording is the easiest and fastest way to map multiple objects.
- TestComplete can store information on the properties and methods of mapped objects to the Name Mapping repository. This way, you will be able to view the properties and methods of mapped objects in test editors even if your tested application is not running.
- TestComplete can capture images of mapped objects. This helps you understand to which UI element of your tested application the mapped object corresponds.
To map a single object -
- Run your application and make sure the needed window or control is on the screen or can be invoked quickly.
- Do one of the following:
- In the Object Browser or in a Visualizer frame, right-click an object and select Map Object from the context menu.
- OR Click Add Object on the Tools toolbar or on the toolbar of the Name Mapping editor.
- Use the target glyph or the “point and fix” mode to select an object on screen or in the Mobile Screen window (for mobile applications).
- If your project does not have the NameMapping item yet, TestComplete prompts you to add it.
- In the resulting dialog, choose if you want to map the object with the default alias and identification properties automatically or if you want to specify them manually:
For each object being added to the Name Mapping repository:
If there are several name mapping templates that match this object, TestComplete prompts you to select the template to use.
TestComplete displays the Object Name Mapping dialog where you can enter the object alias and select the identification properties.
Do one of the following:
In the Name Mapping editor, right-click the parent object in the Mapped Objects tree and select Map Child Objects from the context menu.
In the Object Browser, right-click the parent object and select Map Child Objects from the context menu.
- In the dialog, select the check boxes next to the child objects you want to map.
The object you want to map must exist in the system.
The parent object of the object you want to map must be already mapped.
To map an object from tests, use the
Mapped_Object.AddNamedChild
method. This method is available for all the mapped objects to which you refer by their alias or by a mapped name.
- A mapped name to assign to the object.
- The properties and values to use to map the object.
- Whether to store information on the properties and methods of the mapped object. This way, you will be able to view the object’s properties and methods in test editors even if the tested application is not running.
- An object description.
Comments
Post a Comment