Resolving Object Conflicts In Object Repository Merging In QTP


Understanding Object Conflicts In QTP


Merging two object repositories can result in conflicts arising from similarities between the objects they contain. The Object Repository Merge Tool identifies three possible conflict types:

  •  Similar Description Conflict. Two objects that have the same name and the same object hierarchy, but that have slightly different descriptions. In this conflict type, one of the objects always has a subset of the properties set of the other object.
  • By default, the conflict resolution settings for conflicts of this type are configured so that the target object repository takes the object that has fewer identifying properties than the object with which it conflicts. For information on changing the default settings, see Defining Default Settings.

  •  Same Name Different Description Conflict. Two objects that have the same name and the same object hierarchy, but differ somehow in their description (for example, they have different properties, or the same property with different values).
  • By default, the conflict resolution settings for conflicts of this type are configured so that the target object repository takes the object from both files. The object that is added from the secondary file is renamed by adding an incremental numeric suffix to the name, for example, Edit_1. For information on changing the default settings, see Defining Default Settings.

  •  Same Description Different Name Conflict. Two objects that have identical descriptions and have the same object hierarchy, but differ in their object names.
  • By default, the conflict resolution settings for conflicts of this type are configured so that the target object repository takes the object name from the primary source file. For information on changing the default settings, see Defining Default Settings.
    Note: Objects that do not have a description, such as Page or Browser objects, are compared by name only. If the same object is contained in both the source object repositories but with different names, they will be merged into the target object repository as two separate objects.

Similar Description Conflict

An object in the primary object repository and an object in the secondary object repository have the same name, and they have similar, but not identical, description properties and values. One of the objects always has a subset of the properties set of the other object. For example, an object named Button_1 in the secondary object repository has the same description properties and values as an object named Button_1 in the primary object repository, but also has additional properties and values.

You can resolve this conflict type by:

  • Keeping the object added from the primary object repository only.

  • Keeping the object added from the secondary object repository only.

  • Keeping the objects from both object repositories. In this case, the Object Repository Merge Tool automatically renames the object that is added from the secondary file by adding an incremental numeric suffix to the name, for example, Edit_1.

  • Ignoring the object from the local object repository and keeping the object from the shared object repository (when updating a shared object repository from a local object repository).

Same Name Different Description Conflict

An object in the primary object repository and an object in the secondary object repository have the same name, but completely different description properties and values.

You can resolve this conflict type by:

  • Keeping the object added from the primary object repository only.

  • Keeping the object added from the secondary object repository only.

  • Keeping the objects from both object repositories. In this case, the Object Repository Merge Tool automatically renames the object that is added from the secondary file by adding an incremental numeric suffix to the name, for example, Edit_1.

  • Ignoring the object from the local object repository and keeping the object from the shared object repository (when updating a shared object repository from a local object repository).

Same Description Different Name Conflict

An object in the primary object repository and an object in the secondary object repository have different names, but the same description properties and values.

You can resolve this conflict type by:

  • Taking the object name from the object in the primary object repository.

  • Taking the object name from the object in the secondary object repository.

  • Ignoring the object from the local object repository and keeping the object from the shared object repository (when updating a shared object repository from a local object repository).
Resolving Object Conflicts

Conflicts between objects in the primary and secondary object repositories are resolved automatically by the Object Repository Merge Tool according to the default resolution settings that you can configure before performing the merge. For more information, see Defining Default Settings.

However, the Object Repository Merge Tool also allows you to change the way the merge was performed for each individual object that causes a conflict.

For example, an object in the primary object repository could have the same name as an object in the secondary object repository, but have a different description. You may have defined in the default settings that in this case, the object with the more generic object description, meaning the object with fewer properties, should be added to the target object repository. However, when you review the conflicts after the automatic merge, you could decide to handle the specific conflict differently, for example, by keeping both objects.

Note: Changes that you make to the default conflict resolution can themselves affect the target object repository by causing new conflicts. In the above example, keeping both objects would cause a name conflict. Therefore, the target object repository is updated after each conflict resolution change and redisplayed.

You can identify objects that caused conflicts, and the conflict type, by the icon displayed to the left of the object name in the target object repository pane of the Object Repository Merge Tool and the text color. When you select a conflicting object, a full description of the conflict, including how it was automatically resolved by the Object Repository Merge Tool, is displayed in the Resolutions Options pane.

The Resolutions Options pane offers alternative resolution options. You can choose to keep the default resolution if it suits your needs, or use the alternative options to resolve the conflict in a different way. In addition, for a local object repository merge, you can click the Ignore Object button to exclude a specific local object repository object from the target shared object repository.

Tip: You can also change the default resolution settings and merge the files again. For more information, see Defining Default Settings.

To change the way in which object conflicts are resolved:

  1. In the target object repository, select an object that had a conflict, as indicated by the icon to the left of the object name. The conflicting objects are highlighted in the source object repositories.
  2. A description of the conflict and the resolution method used by the Object Repository Merge Tool is described in the Resolution Options pane. A radio button for each possible alternative resolution method is displayed. For information on each of the conflict types, see Understanding Object Conflicts.

  3. In the Resolution Options pane, select a radio button to choose an alternative resolution method. The target object repository is updated according to your selection and redisplayed.

  4. In the Resolution Options pane, click the Previous Conflict or Next Conflict buttons to jump directly to the next or previous conflict in the target object repository hierarchy.

  5. Repeat steps 1 to 3 to modify additional conflict resolutions, as necessary.

  6. Save the target object repository, as described in Saving the Target Object Repository.

The below stuff is very important and very frequently used by any QTP programmer in Object identification using QTP.
More On Object Properties in QTP 

0 comments:

Post a Comment