Wednesday, January 14, 2015

Object Repository

Based on Context, the Object Repository is of two types.
Local Object Repository - As the Name Suggests, the Object Repository is applicable only for that Action for which the repository has been created/recorded. As we know that QTP creates a New Test with 1 action by default. Local Object Repository can be opened by traversing to Resources -> gt;Object Repository. This is the default OR in QTP.
 Shared Object Repository - The Object Repository is Shared across actions/modules which would be mapped for two or more actions/scripts. Local objects can be exported to be saved into Shared Object Repository by using the option "Export Local Objects" Options. Shared Object Repository can be opened by traversing to Resource ->gt; Object Repository Manager
 Below are the major differences between Local and Shared OR
Local Object Repository(LOR)
Shared Object Repository (SOR)
This Object Repository is available one for each action.
This type of OR is available for multiple tests and for multiple actions.
This is the OR that is available for each tests by default.
This type of OR is usually used in frameworks considering reusuability and maintainability.
Local Object Repository is Editable in Object Repository.
Shared Object Respository is read only by default but can be edited in Object Repository Manager.
It is NOT a standalone file that can edited.
SOR is a standalone file that can be edited easily.
It is Saved with an Extension .bdb
SOR is saved with an extension .tsr
It Should be used when not many tests are working on the same screens of the application under test.
SOR Should be used when there are different scripts interacting with the same type of the object.



The Object Repository dialog box displays a test tree of all objects in the current action or the entire test.




You can use the Object Repository dialog box to view or modify the properties of any test object in the repository or to add new objects to your repository.



The top part of the dialog box displays information about the object:

Information
Description
Logical name
The name that Quick Test assigns to the object.
Class
The class of the object.
Find
Opens the Find dialog box, where you can find a property or value that occurs several times in the same action.
Replace
Opens the Replace dialog box, where you can modify a property or value that occurs several times in the same action.


Viewing the Object’s Properties

The default properties for the object are listed in the Properties pane of the dialog box. The pane includes the properties, their values, and their types:

Pane Element
Description
Type
 icon indicates that the value of the property is currently a constant.

 icon indicates that the value of the property is currently a Data Table parameter.
 icon indicates that the value of the property is currently an environment variable parameter.
 icon indicates that the value of the property is currently a random number parameter.
Property
The name of the property.
Value
The value of the property.
Enable Smart Identification
Indicates whether or not Quick Test uses Smart Identification to identify this object during the test run if it is not able to identify the object using the test object description. Note that this option is available only if Smart Identification properties are defined for the object’s class in the Object Identification dialog box.
Note: When you select Disable Smart Identification during the test run in the Run tab of the Test Settings dialog box, this option is disabled, although the setting is saved. When you clear the Disable Smart Identification during the test run check box, this option returns to its previous on or off setting after the test run.
Add/Remove
Opens the Add/Remove Properties dialog box which lists the properties that can be used to identify the object.


No comments: