To choose where to save objects, you need to understand the differences between local and shared object repositories.
In general, the local object repository is easiest to use when you are creating simple record and run components, especially under the following conditions:
- You have only one, or very few, components that correspond to a given application, interface, or set of objects.
- You do not expect to frequently modify test object properties.
Conversely, the shared object repository is generally the preferred option when:
- You are creating components using keyword-driven methodologies (not using record).
- You have several components that test elements of the same application, interface, or set of objects.
- You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties.
Understanding the Local Object Repository
When you use a local object repository, QuickTest uses a separate object repository for each component. (You can also use one or more shared object repositories if needed. The local object repository is fully editable from within its component.
When working with a local object repository:
- QuickTest creates a new (empty) object repository for each component.
- As you record operations on objects in your application, QuickTest automatically stores the information about those objects in the corresponding local object repository (if the objects do not already exist in an associated shared object repository).
QuickTest adds all new objects to the local object repository even if one or more shared object repositories are already associated with the component. (This assumes that an object with the same name and description does not already exist in one of the associated shared object repositories). - If a child object is added to a local object repository, and its parents are in a shared object repository, its parents are automatically moved to the local object repository.
- Every time you create a new component, QuickTest creates a new, corresponding local object repository and begins adding test objects to the local object repository as you record or learn objects.
- If you learn or record on the same object in your application in two different components, the object is stored as a separate test object in each of the local object repositories.
- When you save your component, the local object repository is automatically saved with the it. The local object repository is not accessible as a separate file (unlike the shared object repository).
Understanding the Shared Object Repository
When you use shared object repositories, QuickTest uses the shared object repositories you specified for the selected component's application area. You can use one or more shared object repositories. (You can also save some objects in a local object repository for each component if you need to access them only from the specific component.
After you begin creating your component, you can specify additional shared object repositories. You can also create new ones and associate them with your component. Before running the component, you must ensure that the object repositories being used by the component contain all the objects in your component. Otherwise, the component may fail.
You modify a shared object repository using the Object Repository Manager.
When working with a shared object repository:
- If you record operations on an object that already exists in either the shared or local object repository, QuickTest uses the existing information and does not add the object to the object repository.
- If a child object is added to a local object repository, and its parents are in a shared object repository, its parents are automatically moved to the local object repository.
- QuickTest does not add an object to the shared object repository as you record operations on it. Instead, it adds new objects to the local object repository (not the shared object repository) as you learn objects or record steps on them (unless those same objects already exist in an associated shared object repository).
You can export the local objects to a shared object repository.
You can also merge the local objects directly to a shared object repository that is associated with the same component. This can reduce maintenance since you can maintain the objects in a single shared location, instead of multiple locations.
1 comment:
Thanks this was a useful blog for understanding Object Repositories in QTP.
Post a Comment