https://www.qatechies.com

HP UFT or QTP: ObjectRepositoryUtil Tool

Concept

HP UFT or QTP: ObjectRepositoryUtil Tool


Welcome to this post!-“ HP UFT or QTP: ObjectRepositoryUtil Tool

If you are looking for latest HP UFT QTP interview Questions, then you are at right place. This post “HP UFT or QTP: ObjectRepositoryUtil tool” consists of concept discussion and general interview questions which have been part of many interviews either external or internal. Usually these are assumed to be known in deep to check the logical solvency efficiency of the candidate and of course suitability for the project and company. Go ahead and enjoy reading…

This discussion will help you prepare well if you are going for the interview or you need the function to be used in your project.

In the interview usually, you might be questioned in different ways like:

  1. How to add test object in OR without using object repository manager?
  2. How can you delete any test object in shared OR using ORM?
  3. How to export the objects to import them in another test project?

We will discuss many more later, but let’s focus on understanding the concept of this utility provided in HP UFT or QTP and in the same discussion you can find answers to all the questions.


ObjectRepositoryUtil

 

Abstract:

The Object Repository (OR) automation object model (AOM) supports in manipulating QuickTest shared object repositories, plus manipulation can be done with their contents from outside of QuickTest. All activities relating to the manipulation of repository objects can be done using a scripting tool to access QuickTest shared object repositories via automation.

 

Discussion:

 

To alter any property, delete or add new test object in OR irrespective of type an automation tester uses Object Repository Manager (ORM). Well, the changes to test object can also be done via script. Any automation tester can write automation programs or more specifically scripts (in terms of UFT) in any language and development environment that supports automation. For example, tester can use VBScript, JavaScript, Visual Basic, etc.

Instead of performing operations on objects of repository manually using the Object Repository Manager (ORM) an automation tester can use the objects and methods of the Object Repository AOM to write scripts that manipulate shared object repositories. For example, tester can add, remove, rename objects, import from xml, export to XML, retrieve and copy objects etc. Once object is retrieved tester can alter or modify using the methods and properties available for that test object class. For example, tester can use the GetTOProperty or SetTOProperty methods to retrieve and modify its properties.

 

The object model of ObjectRepositoryUtil looks like below:

Parent Child
ObjectRepositoryUtil GetAllObjects(TOCollection)
GetAllObjectsByClass(TOCollection)
GetChildren(TOCollection)
GetChildrenByClass(TOCollection)

 

 


When this comes into picture?

That’s a really good question! when should one use this or consider this utility, what could be the situation that may lead to use this tool in the project.

The situation could be like the project is developing some components on which part of the test team is working. The test team is divided into geographical regions or divided by physical barriers, and this part of the test team is specifically working with test objects via scripts to merge it with their developing components which are going to have similar properties. This situation is quite practical and encountered often where Agile or DevOps is followed.

 

The other situations are like:

  1. new web components of main website are in development and you need to transfer the old test objects to this new web component’s OR, or
  2. the application has got rich UI and new controls have been introduced but there are very few changes in terms of test object properties, or
  3. the test suite is completely handled by script, then use of ObjectRepositoryUtil is obligatory.

 

Now let’s got through some methods which can be used within AOM script along with their description:

 

Method Name Description
AddObject  This method adds the specified object to the object repository under the specified parent object.
Convert  This method converts the specified object repository file (like version 8.2.1 or earlier) to the current format.
CopyObject  This method creates a copy of the specified object in the object repository.
ExportToXML  This method exports the specified object repository to the specified XML file.
GetAllObjects This method retrieves all objects under the specified parent object.
GetAllObjectsByClass  This method retrieves all objects of the specified class under the specified parent object.
GetChildren  This method retrieves all direct children of the specified parent object.
GetChildrenByClass  This method retrieves all direct children of the specified class under a specified parent.
GetLogicalName  This method retrieves the name of the specified object.
GetObject  This method retrieves the object according to the specified path.
GetObjectByParent  This method retrieves the object according to the specified parent object and object name.
ImportFromXML  This method imports the specified XML file to the specified object repository.
Load  This method loads the specified object repository file.
RemoveObject  This method removes the specified object from the object repository.
RenameObject  This method renames the specified object in the object repository.
Save  This method saves any changes made while running an object repository automation script.
UpdateObject  This method updates the object repository with any changes made to the specified object.

 


TOCollection

 

When programmar wants to iterate through the items of the test object collection, he has to use the TOCollection object methods to access items. Officially, this is a collection of object repository objects, returned by methods of the ObjectRepositoryUtil object when used.

 

And also, this object has following methods:

 

Method Name Description
Count Returns the number of items in the object collection.
Item Returns the object with the specified index from the object collection.

 


Conclusion

Let’s conclude our discussion with few good QTP interview questions on this ObjectRepositoryUtil :

 

  1. How to add test object in OR without using object repository manager?
  2. How can you delete any test object in shared OR without using ORM?
  3. How to export the objects which later can be used in another project?
  4. Import of test objects can be done via AOM?
  5. Can VBScript script be used to alter the test object properties or any OR?
  6. Can tester utilize the load method to load more than one OR during execution?
  7. Can tester get the count of test object the test object collection has? if yes how?
  8. Transfer of OR objects from OR to another is possible?

 

This brings us to the end of our discussion on “HP UFT or QTP: ObjectRepositoryUtil Tool”.

 

I really hope you have enjoyed reading this short post. If you have any doubt on this please feel free to add your comment below.


And if you like to read more on UFT or QTP Technical Interview Questions please follow below links:

 

UFT Technical Interview Questions – Set 1

UFT Technical Interview Questions – Set 2

How to Download Resource From QC\ALM?

How to Upload Resource To QC\ALM?

 

Or if you prefer General Interview Questions please follow below links:

 

UFT General Interview Questions – Part 1

UFT General Interview Questions – Part 2


If you would like to keep track of further articles on UFT (QTP). I recommend you to SUBSCRIBE by Email and have new UFT articles sent directly to your inbox.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

advanced-floating-content-close-btn
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5034726663464946 (adsbygoogle = window.adsbygoogle || []).push({});
advanced-floating-content-close-btn 
*************************** Do you want to learn TOSCA? Do you want to excel in Career? Try my New Courses: 1. Tricentis Tosca and Working with Excel   2. Tricentis Tosca and UI Automation Great News!!   Price has been slashed down for limited period of time.So Hurry!!! Click The Shown Links and Enjoy Learning. ***************************
 
error: Content is protected !!