Wednesday, May 11, 2011

How To work with Object Repository


Adding the objects in object repository:

Ø      Open the object repository
Ø      Click on add objects button
Ø      Click on the title bar of the window
Ø      Click on ok
Ø      Select one of the following options
a) Only the selected objects
b) Selected objects and all its direct children
c) Selected objects and all its descendants
Ø      Click on OK

Deleting the objects form the object repository:
Ø      Select the desired object to be deleted in the object hierarchy
Ø      Right click on it
Ø      Select the option delete
Ø      Confirm the deleting by clicking on yes
Or
Ø      Select the desired object to be deleted in the object hierarchy.
Ø      Press on Delete available on keyboard

 Re-naming the objects:
Ø      Select the desired object in the object hierarchy
Ø      Right click on it
Ø      Select the option Rename
Ø      Specify the desired name
Or
Ø      Select the desired object in the object hierarchy
Ø      Press F2
Ø      Specify the desired name

Updating the properties list:
Ø      Select the desired object in the object hierarchy
Ø      Click on add/Remove button
Ø      Select the desired properties to be added in to the properties list
Ø      Deselect the properties to be removed from the properties list
Ø      Click on OK

Highlight:
Highlight button is used for highlighting the corresponding object in the AUT so that a test engineer can clearly understand which objects information is that.




Object identification

Object identification:

Object identification is based on four types of properties and an ordinal identifier
 1. Mandatory Properties
 2. Assistive properties
 3. Base-Filter Properties
4. Optional Filter properties

QTP learns the information in the following in case only normal brain:

First of all the QTP will learn all the mandatory properties at a time and then think whether these properties are sufficient to identify the object uniquely. If it feels sufficient then it will stop learning otherwise it will learn the first assistive property and once again stops and thinks whether these properties are sufficient to identify the object uniquely. If it feels sufficient then it stops learning otherwise learns the second assistive property and checks whether these properties are sufficient or not. This process continuous till the QTP satisfies or up to the end of the assistive properties list. At the end of the assistive properties list also if it feels not satisfied then it will finally learn the ordinal identifier and stops learning.



QTP learns the information in the following way in case of smart brain also (smart identification):

While learning the mandatory properties along with them it will learn the base filter properties, optional filter properties and stores them in the secret place.

It considers the mandatory properties only and check whether these properties are sufficient to identify the object uniquely and repeats the above process.

 Note: In the above learning process except base filter properties and optional filter properties all the remaining information learnt will be stored in the object repository.


Whenever the QTP is unable to identify the objects with the help of the properties present in the object repository then the special mechanism provided by QTP to identify the object smartly with some other properties is known as smart identification.

QTP will use the information in the following way to identify the object during execution:
 First of all QTP will use all the properties present in the object repository except ordinal identifier and try to identify the object. If at all the object is not identified then it will forget about all these properties and freshly enters in to the secret place.

QTP will consider all the base filter properties and try to identify the object and forms a list of all the objects that are matched with the base filter properties.
If the list contains only one object then that is the object otherwise it will take the support of first optional filter property and try to match with all the object present in the list and forms a new list of all the objects that are matched with that property and then check whether the list is containing one object or more that one object. If the list is containing more than one object then it will consider the second optional filter property and repeats the whole procedure till the list contains on object or up to the end of the optional properties list.
At the end of the optional filter properties list also if the list is containing more than one object then it will finally go to the object repository and check whether the ordinal identifier is available or not. If at all the ordinal identifier is available it will identify the object roughly using that otherwise it will fail.

Ordinal Identifiers:
 There are three types of ordinal identifiers
  1.Location
  2.Index
  3.Creation time


1.Location:
If at all the location is selected, as an ordinal identifier then the QTP will generate a sequence of numbers from 0,1,2,3 based on the sequence of the objects located in AUT.

2.Index:
  If at all the index is selected as an ordinal identifier than the QTP will generate the numbers from 0,1,2,3…. Based on the sequence of the programs of the objects.

3.Creation Time (specially for web pages):
 If at all creation time is selected as an ordinal identifier the QTP will generate the number from 0,1,2,3,… based on the loading time of the web pages