Effect of Deleting Objects on Size of QTP Object Repository
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.