Friday, 12 June 2015

QTP - 26 - TOM

It is a collection of objects types or classes that are used to represent objects in application. A test object class comprises of a list of properties that can uniquely identify the object. Basically,object means any data in application that supports methods and properties. QTP support two types of  objects as,


Test Object(TO) :- QTP creates an object during recording mode that correspond to object in application called as Test Object.The properties of objects are stored in in Object Repository that are used to identify object during run session.

Run Time Object(RO) :- The object that QTP uses to identify actual object in application during run session is Run Time Object. QTP uses the properties stored in object repository to identify actual object in application during run session.
You can add objects in object repository simply by recording events in application or by manually in object repository.

Both TO and RO supports various properties and methods.These properties can be retrieved using GetRO property and can be set using SetTO property.
Use Object Spy to view properties and methods supported by objects.


The properties of each test object is created and maintained by Q.T.P while the properties of run-time object s are created and maintained by the test object architect.

Methods and Properties  :

- Each method/operation that we perform on test object is recorded as separate step in Q.T.P.

- Each properties of object are captured from test objects while recording. QTP uses these properties to uniquely identify objects during runtime.

- Property of any TO can be changed , we can use setTOProperties to change the property of any TO.

- Object Spy is used to see the hierarchy of any TO


Object Hierarchy in QTP:-

its Very important to know the hierarchy of any object to uniquely identify it and perform any operation on it.

If object is on simple page then Hierarchy will be as shown:-


In the expert view,you can view your statement as:-

Browser(" ").Page(" ").WebList(" ").Select" "

If object is on simple page having frame then Hierarchy will be as shown:-




In the expert view,you can view your statement as:-

Browser(" ").Page(" ").Frame("MainFrame").WebElement(" ").click

If object is on Window then Hierarchy will be as shown:-














In the expert view,you can view your statement as:-

Browser(" ").Window(" ").Page(" ").Frame("ebRealModal").WebElement(" ").click



If object is on Window which is on other window then Hierarchy will be as shown:-

In the expert view,you can view your statement as:-

Browser(" ").Window(" ").Window(" ").Page(" ").Frame("ebRealModal").WebElement(").click

No comments:

Post a Comment