Frequently asked questions about object recognition and object maps in Rational® Functional Tester
This topic provides answers to some frequently asked questions about object recognition and test object maps.
- What is an object map and why is it needed?
- What happens if two different objects have the same name?
- What is the difference between a private and public object map?
- What do the weights on the recognition properties mean and how are they used?
- Can the default weights that are assigned to each property be modified?
- Can a property weight or value be modified for all objects in a project or all objects of a specific type?
- Can scripts that were created with private maps be merged to a public map?
- Can a private map be made public?
- Do changes to the object map hierarchy need new sections in the object map for all child objects?
- Can properties that are used for object recognition be modified?
- Can a script reference more than one object map?
- Can individual objects be copied from one map to another?
- What are the performance metrics of an object map as it grows in size?
What is an object map and why is it needed?
An object map contains each object that was acted upon during recording, as well as the object's recognition properties. For each property, the map also contains a weight that indicates how heavily Rational® Functional Tester relies on that property for recognition.
The object map can be automatically populated when a script is recorded, or manually by adding objects to the map.
The object map aids efficient script maintenance. When objects in the application under test are modified, the object map is a single source that can be updated. By updating the map, all scripts that reference the modified object use the updated object information.
What happens if two different objects have the same name?
Rational® Functional Tester differentiates objects based on recognition properties and hierarchy. For example, if a button exists in a different top-level window, then it appears as a different button in the map. If two or more different objects have the same name, to make the name unique, Rational® Functional Tester adds number suffixes to the name of the object that is second, third, and so on.
If there are two identical instances of any objects, such as two instances of a browser, Rational® Functional Tester provides a method to handle identification.
What is the difference between a private and public object map?
A private object map is used by a single script. A public (shared) object map is used by multiple scripts. The default setting is for each script to use a private object map. This is appropriate for single users who are starting to learn the tool. However, a team of testers working on a common application should use a shared object map so that they can take advantage of objects being globally defined in a single map.
What do the weights on the recognition properties mean and how are they used?
The weights indicate how important a specific property is for identifying an object during script execution. The possible settings are 0 (not important) to 100 (very important). You can change the weights of most of the properties. The .class property is fixed and cannot be changed.
If you set the weight to 0, the value of that property is ignored when attempting to identify an object.
Can the default weights that are assigned to each property be modified?
Use the Object Property Configuration Tool to assign new default weights to properties and also define new properties to be used when identifying objects in future recordings.
Can a property weight or value be modified for all objects in a project or all objects of a specific type?
You can use the Object Map Find and Modify utility to find all objects that match a criteria such as property name, property value, or various custom filters. Actions that can be taken on the matching objects include Add Property, Remove Property, Change Value, and Change Weight. Modifications can be applied to objects either one at a time or globally.
Can scripts that were created with private maps be merged to a public map?
Yes. To merge the scripts, create a new public map by clicking Merge Objects into. In the dialog box that is displayed, select the scripts to merge. Ensure that you select the Connect selected Functional Test scripts checkbox to attach the selected scripts to the new merged object map.
. If a wizard page opens, close it. Right-click the created map and selectFor information about merging multiple maps, see Merging multiple test object maps.
Can a private map be made public?
- Select .
- Select the folder where you want the new public map created and then type the new map name. You can also select the checkbox to set this test object map as the default choice for new Rational® Functional Tester scripts. Click Next.
- Select Test Object Maps and scripts to copy Test Objects from.
- Select the script that contains the private map that you want to be made public. You can also select the Connect selected scripts with the new Test Object Map checkbox.
Do changes to the object map hierarchy need new sections in the object map for all child objects?
If the properties of parent node change due to insertions or deletions, or a new node is added to the hierarchy, you can update the map. To update the map, use the map editor to insert references to objects that have a newly inserted parent. You then have duplicate references for the child objects of the new object. For each of these references, drag the old object to the new, so that the map editor unifies the objects. You can use the same steps to delete an object from the map hierarchy.
Can properties that are used for object recognition be modified?
Yes. Open the object in the object map then select Add to Unified Test Objects Properties.
. Use the object finder to point to the object. When the Update Recognition Properties dialog box with the three panes appears, right-click a property in the All Active Properties pane and selectCan a script reference more than one object map?
No.
Can individual objects be copied from one map to another?
No.
What are the performance metrics of an object map as it grows in size?
As an object map grows, the time required to open and load the map increases.
When a script runs, the object map is loaded the first time it is needed during the run. If you have a test case suite that uses functional test scripts, the map loads as each script runs, because each script is a separate process. A typical application would have approximately 2000-3000 objects (some maps could be larger or smaller).
The metrics shown in Table 1 were computed at script run time but can also apply when the map is loaded. They show that a significant increase in map load time does not occur till a map well beyond normal size is encountered. Playback time increases only at the beginning of the script run when the map is loaded, and it does not slow down the script run after the map is loaded. Additionally, nested scripts (using the callScript function) that share the same object map also share the same map instance during script run. Hence, nested scripts do not increase the load time.
Objects in map | Seconds for total script execution |
---|---|
10 | X seconds |
600 - 2000 | X + 2 seconds |
2000 - 11000 | X + 3 seconds |
more than 11000 | X +10 seconds |