Object Repository is the most important utility that UFT has in its bag. In this post, we will learn about OR detailed version.
In the “previous post” we have looked at Object repository storing properties of objects while recording or when objects are added manually. Below is the image which has features listed in OR. The objects include text fields, edit boxes , combo boxes , lists , radio buttons, images , texts etc.
Object Identifier :
The object identifier is the name of the object which is similar to the name of a mobile phone. Every object, that is in object repository, has a identifier listed . In the image above, ‘Agent Name’ is the object identifier.
Object Class :
There are numerous objects in an application, for windows application : edit box , radio buttons, text fields, combo box, check boxes etc. Whereas, for web application : Page, image, link, elements, Table etc. All these objects are identified based on their respective classes. Here, ‘Agent Name’ is of class ‘Win Edit’.
Object Location:
Object location indicates where the object is stored . Shared object repository and Local object repository are two locations where the properties are stored.
Local Object repository:
When the objects are stored as ‘local’, It means they are available only to the current action e.g ‘Action 1’ (in the image left pane) in this case. The objects added to the local Object repository, cannot be accessed by any other action, even if they are the part of same test.
Its bit confusing, to simplify – You need to understand that, a test can have multiple actions associated to it. for example: sending an email has two actions associated. Action 1 is Login to gmail and Action 2 is Compose and send. Now read the above description again and you will get it easy.
.mtr is the file extension of Local Object Repository.
Shared Object repository :
As the name indicates, It has a global scope and the object repository can be used by ‘n’number of actions in ‘n’ number of tests. To create shared object repository. Goto file /Export local objects . a dialogue box appears to create shared object repository. This is shown in the below image.
.tsr is the file extension of Shared Object Repository.
Object Properties :
These are the properties which are used to identify the objects in application. In Image 1, the agent name has ‘Native class and ‘attached text’ properties are listed which are know as mandatory properties . This list comes from the Object Identification settings under Tools/ Object identification.
we will discuss about Object identification in the further posts . For now, note that there are certain mandatory and assistive properties for identification. There are in fact other details also.
Visual Identifiers :
These are used to enhance the object identification and reduce the risk of false object recognition. It helps to identify the objects using its relative location to the neighbouring objects. In the below image every button ‘Click here for’ has some text associated to it (vegeterian , non vegeterian etc). So, in this case you select the neighbouring objects that will have same relative position to the object we are working on and used to identify the objects.
Ordinal Identifiers :
These are the properties that are used in addition to the mandatory and assistive properties to identify the Objects uniquely. For example, if there are three buttons which have same properties, name , class etc, then Ordinal identifier comes into picture. Observe the image closely.
There are three types of Ordinal Identifiers:
Index :
Indicates the order in which the object appears in the application code relative to other objects with has same name description. It starts with 0. In the above image the ‘Click here for’ vegeterian has index ‘0’, then non-veg has index 1 and so on.
Location :
The order of object in its parent window, frame or dialog. The first occurrence is 0.Values are assigned for this ordinal identifier from top to bottom and left to right.
Creation time :
This is used for the Browsers only. Indicates the sequence in which the browser is opened. The browser opened first has the assigned value 0.
This is about the features of object repository. In the future posts we will discuss about the object identification, order of identification and smart identification concepts.