Object Repository

Interview Questions on QTP Object Repository

  
1) What is Object?

Object is something which has structure and properties

General Example:
---------------
Object    Property    Value
------    --------    -----
Table    Height        40 cm
           Width         30 cm
           Color          Blue


Software Example:
---------------
Object    Property        Value
------    --------            -----
Button   text              OK
           window id       2001
           visible            True


2) What are the types of Objects in QTP?
       
There are 4 types of Objects in QTP
        a) Run-time Objects
        b) Test Objects
        c) Utility Objects
        d) Automation Objects

3) What is Run-time Object?

Object that is present in the application under test(AUT) is called Run-time Object.
       
Status of Run-time Objects:
---------------------------
a) Visible
b) Invisible/hidden
c) Enabled
d) Disabled
e) Focused
  
4)    What is Test Object?
       
Reference of Run-time Object is called Test Object. Test object names vary from one environment to other Environment. Using Object Spy Test Object information can be known.
       
Status of Test Objects:
-----------------------
a) Constant Object - Whose property values are fixed.

b) Dynamic Object - Whose property values change dynamically throughout the execution.

c) Duplicate Object – Two are more objects with similar properties

Using index property we handle duplicate objects. Example: News link in Yahoo home page.
       
5)  What is Utility Object?

QTP reserved Objects used for Testing and Result reporting are called Utility Objects.
All Utility Objects  are Unique.

Example:

SystemUtil - Used for Launching/Closing the application.

RepositoriesCollection –for dynamic handling of Object Repositories

Reporter – for Defining Test Result
       
6)    What is Automation Object?

User defined Objects used to work with Drives, Folders, Files and Databases.

Example: User can define FileSystemObjects, ExcelObjects, Database Connection Objects.
       
7)    What is Object Spy?

Object Spy is a feature provided in QTP to get the Objects Information like Test Objects names, Property and values.

Navigation in QTP:
-----------------
Tools->Object Spy
       
In Object Spy window Click on Hand Icon and show the Object to get the information.
               
8)    What is property? 

It is an attribute of the Object that describes the Object.
  
9)    What is Object Repository?

Object Repository in QTP is a storage place for storing Test Objects information. 


It also acts an interface between the Test Script and the AUT in order to identify the objects during Execution.

10)    What are the types of Object Repositories in QTP?

There are two types of Object Repositories in QTP.
       
a) Local Repository - Internal File(.mtr)
       
b) Shared Repository - External File(.tsr)

11)    What is Local object Repository?

QTP creates a Local Repository for every action automatically during recording and user can edit (Rename, Delete, Add) local Objects.

Any modifications made in Local Repository are saved automatically.

Navigation:
-----------
Resources->Object Repository
  
12)    What is Shared Object Repository?

User creates Shared Repository either by adding Objects or by exporting local Objects.

Navigation:
-----------
Resources->Object Repository Manager

13)    What are the file extensions for Local and shared Repositories?
Local Repository - .mtr (Module Test Respository)
Shared Repository - .tsr (Test Shared Repository)
       
14)    How to rename Local Objects?

Open Object Repository. Select an Object and Right Click. Select Rename option

Resources->Object Respository->select Object->Right Click->select Rename Option->Modify Object name->Release the mouse->Close Repository.

15)    How to delete Local Objects?

Resources->Object Repository->Select Object and Right click->Select Delete Option->Confirm Deletion->Close repository
       
16)    How to add objects to Local Repository?

Resources->Object Repository->Object Menu->Add Objects to Local->Show the Object->Click OK

17)    How to rename Shared Objects?

Resources->Object Repository Manager->File menu->Open->Browse the Repository File->File menu->Enable Editing->Select Object and Right click->Select Rename Option->Modify name->Release Mouse->Save the Repository file->Close Repository Manager

18)    How to delete Shared Objects?

Resources->Object Repository Manager->File menu->Open->Browse the Repository File->File menu->Enable Editing->Select Object and Right click->Select Delete option->Confirm Deletion->Save the Repository File->Close Repository Manager

19)    How to create a Shared Repository?

Resources->Object Repository Manager->Object->Add Objects->Show the Object->Click Ok->Save the Repository File

20)    How to export Local Objects?

Resources->Object Repository->File Menu->Export Local Objects->Save the Repository File

21)    How to merge two Repositories?

Resources->Object Repository Manager->Tools->Object Repository Merge Tool->Browse Path of First Repository and Second Repository->Click Ok->Click Close->Save the Merged Repository->Close the Repository Manager

22)    How to map objects in between Object Repository and Application?

View option in Object Repository is used to Map Objects between Object Repository and AUT.

Resources->Object Repository->View
Resources->Object Repository Manager->View
There are two options to view.
a) Locate in Repository: This is used to identify Objects from Application to Repository
           
Resources->Object Repository->View->Locate in Repository->Show the Object->Click Ok

It locates specified object in the Repository.

b) Highlight in Application: This is used to identify Objects from Repository to Application

Resources->Object Repository->Select Object->View->Highlight in application

It highlights the specified object in the application.

23)    How to export Test objects to XML?

Resources->Object Repository Manager->File->Export Test Objects to XML->Save the File

24)    How to import Test objects from XML?

Resources->Object Repository Manager->File->Import from XML->Browse the path of XML file

25)    How to Associate Object Repositories to an Action?

Resources->Associate Repositories->Click (+) Icon->Browse path of the Repository file->Associate with an Action->Click Ok
       
26)    How to Load Shared Object Repositories directly at Run-time?

Shared Object Repositories can be loaded at Run-time using the Utility Object "RepositoriesCollection"
Syntax:
-------
RepositoriesCollection.Add "Path of the Repository File"
       
27)    How to define New Test Objects?

Resources->Object Repository Manager->Object->Define New Test Object
       
28)    What is the purpose of defining New Test Objects?

Purpose of Defining New Test Objects is, Though Application is not ready Test Design process can be started by getting Objects information(from Dev).

29)    How handle Object Repositories dynamically?

Loading Repositories during run-time, finding path of the repositories and removing repositories is called Dynamic handling of Object Repositories.

Using "RepositoriesCollection" Object, we can handle Object Repositories Dynamically.      

30)    What is Dynamic Object?

An Object whose property value changes dynamically throughout the execution is called Dynamic Object
       
31) How to handle Dynamic Object?

Dynamic Objects can be handled using Regular Expressions.

32)    What is Duplicate Object?
       
Two are more objects with same properties in a Parent object.

Or

Same Object located in multiple locations in a Parent Object is called Duplicate Object

33)    How to handle Duplicate Objects?

Duplicate Objects can be handled using Index Property.

Object index starts from top left to bottom right (o to n-1)

34)    How to get Object information without using Object Spy?
       

35)    What is Object Repository Manager?
Object Repository Manager enables you to manage all of the shared object repositories.

36)    How to compare Object Repositories?

Object Repositories can be compared using Object Repository Comparison

Tool in Object Repository Manager

Resources->Object Repository Manager->Tools->Object Repository Comparison Tool

37)  What are View Options in Object Repository?

View Options in Object Repository

a) Locate in Repository: This is used to identify Objects from Application to Repository

Resources->Object Repository->View->Locate in Repository->Show the Object->Click Ok
It locates specified object in the Repository.
       
b) Highlight in Application: This is used to identify Objects from Repository to Application

Resources->Object Repository->Select Object->View->Highlight in application

It highlights the specified object in the application.

38) How to map Object Repository parameters?

Resources->Map Repository Parameters

39) What is Virtual Object Configuration?

It is a process of making an area or user defined object as Virtual Object

Whenever QTP is not recognizing an area or user defined object as an Object that we can make as a Virtual Object.
       
40) How to Configure Virtual Object?

Virtual Objects can be configured using Virtual Object Manager feature in QTP.

Tools->Virtual Objects->New Virtual Object

0 comments:

Post a Comment