site
stats
By Anish Pillai Anish Pillai Posted under QTP Concepts

Effect of Deleting Objects on Size of QTP Object Repository

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
How do you add objects to your Object Repository? Do you select the top level object, add all objects under it and then delete the ones not needed? Or do you add objects by selecting single object each time? Ever wondered how deleting an object effects the size of your object repository?
Did you ever face a situation where you needed to copy some objects from one object repository to another? For the obvious ease of copying the objects and maintaining the same ‘object hierarchy’, did you copy the entire nodes from one repository to another and then deleted the objects that you didn’t need? Let’s try to find out how deleting objects from QTP object repository affects the size of the repository.Objective: To add the calculator result display object in the object repository.Methods to add the object: 
1. We will create a new Object Repository and add only the result display object and check the size of the repository.
2. We will create one more object repository and add the parent calculator window together with all its child objects in object repository. We’ll then delete all the remaining objects except the result display object. We’ll note down the size of this object repository and compare it with the size of the previously created repository. Let’s see what are the results. 

The display screen object (marked in black) that needs to be added in OR

Method 1: Add single object to the repository. a) Create a new shared object repository in QTP and add the display screen object from calculator application. Save the repository in the local drive.

Object Repository with Single Object

b) Note down the size of the object repository from the local drive. For this test, the size of the repository is coming out to be 192 KB (as shown in below figure).

Size of the Repository with single object



Method 2: Adding the parent calculator window (together with all its child objects) in the object repository and then deleting all the objects except display result screen object. 

a) Create another shared object repository and select the parent calculator object to add to the repository. It will ask for what objects to be added to the repository. Select ‘All Object Types’ radio button and click on OK button. The calculator parent window together with all the controls inside the window get added to the repository.

b) Save the object repository in the local drive (In this example we have added the objects from calculator’s Scientific, Programmer and Statistics screens also so that the size of the object repository increases). 

Object Repository with all the Calculator Objects



c) Note down the size of the object repository. In this test, the size of the repository is coming out to be 640 KB (as shown in below figure).

Size of the Repository with all calculator objects



Now from this repository, let us delete all the objects except result display object and check how it affects the repository size.

a) Delete all the objects from the repository except the result display object. Save the repository.

b) Note down the size of the repository. The size here is shown as 624 KB.

Size of the repository after deleting objects.



The above example shows that even after deleting the objects from the repository the size of the repository doesn’t change much. It has only slightly reduced from 640 KB to 624 KB. Whereas the size of the object repository where we added single result screen object came out to be 192 KB.


Resolution: If a user finds himself/herself in such a situation due to the constant adding and deleting of objects, the user can follow the below mentioned approach.

=> Create a new object repository and copy all the objects (user can copy the top level object also to copy all the objects in one go) from the old bulkier repository to the new one. Save the new repository and check the size of this repository. This new repository would not contain the references of the deleted objects from the old repository and hence its size would be lesser.

 

If you enjoyed this article, you can join our blog to get free email updates directly in your inbox.

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
  • kumar

    hello sir,

    I am unable to see the images in the above article.. can up plz make then visible.

    thanks,

    kumar

    • Anish10110

      I will check the issue and will rectify it.

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×