0% found this document useful (0 votes)
49 views

Object Repository

The document discusses object repositories in automation testing. It defines an object repository as a storage place for object information that acts as an interface between test scripts and the application under test. There are two types of object repositories: local and shared. Local repositories maintain separate repositories for each action while shared repositories maintain the same repository across multiple actions or tests. The document also covers operations like adding, modifying, and deleting objects in shared repositories as well as merging shared repositories.

Uploaded by

Hari Krishna
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Object Repository

The document discusses object repositories in automation testing. It defines an object repository as a storage place for object information that acts as an interface between test scripts and the application under test. There are two types of object repositories: local and shared. Local repositories maintain separate repositories for each action while shared repositories maintain the same repository across multiple actions or tests. The document also covers operations like adding, modifying, and deleting objects in shared repositories as well as merging shared repositories.

Uploaded by

Hari Krishna
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Object Repository

It is a storage place where we can store the object information and it also acts as an interface between Test Script and AUT (Application Under Test) in order to identify the objects during execution.

Types of Object Repositories:


There are 2 types of Object Repositories: 1. Per Action (or) Local 2. Shared Per Action (or) Local: Maintaining separate OR for each and every action. Extension: .mtr (module test repository) Shared Object Repository (SOR):
Maintaining same OR to multiple actions or tests Extension: .tsr (test script repository) Navigation for creating SOR:

OR File menu select Export Local Objects... Save the file in the required location with extension .tsr
Navigation for associating SOR:

OR Tools menu select Associate Repositories Click + button and Open required SOR file select required action Click OK button (OR) Resources menu select Associate Repositories Click + button and Open required SOR file select required action Click OK button
Operations on Shared Object Repository (Add, Modify, Delete objects / properties):

Resources menu select Object Repository Manager Open required shared object repository file Click on Enable Editing icon and perform required operation Click on Save button

Highlight:
Whenever Test Engineer is confused with any object information in the OR window, then by highlighting the corresponding object he can get clarification which object information is that.
Navigation: Open OR Select required object in OR Click on Highlight button.

Merging Shared Object Repositories:


Navigation: Resources menu Select Object Repository Manager Tools menu

select Object Repository Merge Tool Browse required Shared Object Repository files Click on OK button click on Save button

Types of Objects:
With respect to OR we have 2 types of objects: 1. Test Objects: Objects which are in OR, those objects we are calling as Test Objects. 2. RunTime Objects: Objects which are in AUT, those objects are calling as Runtime Objects. Note: Every TO object is RO object and every RO object is may or may not be TO object. Working with TO objects: Get To Property: By using this method, we can retrieve test object property value during runtime. Syntax: <obj hierarchy>.GetTOProperty (property name) Ex: Msgbox Dialog ("Login").WinEdit("Agent Name:").GetTOProperty("nativeclass") Get To Properties: By using this method, we can retrieve multiple property names and their values for Test Object.

Syntax: <obj hierarchy>.GetTOProperties ( ) Ex: Retrieving all property names and their values for Test Object. Option Explicit Dim propertyLst, indx Dim pName,pValue Set propertyLst=Window("Flight Reservation").GetTOProperties() Msgbox propertyLst.Count For indx=0 to propertyLst.Count-1 pName=propertyLst(indx).Name pValue=propertyLst(indx).Value Msgbox "Property Name= "& pName&" Property Value= "&pValue Next 'Destroy user defined objects Set propertyLst=Nothing

Note: whenever a variable is containing more than one value then Set will be declared

Set To Property: By using this method, we can change Test object property value during run time Syntax: <obj hierarchy>.SetToProperty property name, new property value Ex: Write a test script to click on same object (start button) four times (Text property value of the object is changing from start to stop) Option Explicit Window("XingMPEG Player").WinButton("play1").Click Window("XingMPEG Player").WinButton("play1").SetTOProperty "text","stop" wait(15) Window("XingMPEG Player").WinButton("play1").Click Window("XingMPEG Player").WinButton("play1").SetTOProperty "text","play1" wait(15) Window("XingMPEG Player").WinButton("play1").Click Window("XingMPEG Player").WinButton("play1").SetTOProperty "text","stop" wait(15) Window("XingMPEG Player").WinButton("play1").Click

Working with Run time objects GetRoProperty (): By using this method, we can retrieve Run time object property value. Syntax: <obj hierarchy>.GetRoProperty (<property name>) Ex: Msgbox Dialog("Login").WinButton("OK").GetROProperty("enabled")

When do we go for GetToProperty() and GetRoProperty():

1. Whenever the object is available in OR and property is also available in


Description properties List then we can use either GetToProperty() (or) GetROProperty()

2. Whenever the object is available in OR and property is not available in


Description properties List then we can use GetROProperty() only

3. Whenever the object is not available in OR then we can use GetROProperty()


only Ex: Msgbox Dialog("text:=Login").WinEdit("attached text:=Agent Name:").GetROProperty("nativeclass")

You might also like