11-12-2014, 10:42 AM
These are the following components:
QTP Test objects
As you can see, the static text and the edit boxes have the same ‘text’ property.
If I know that one of them is a static text and the other is WinEdit object, then there is no problem at all. Say if all these are treated as WinObject then I will have to specify which object to act on. This is only going to happen when the mandatory, assistive and smart identification have failed. So in order to tell QTP which is what, I am going to assign an ‘Index’ ordinal identifier. I will do so from the OR.
QTP Ordinal Identifier
I will set the Agent name static text identifier as 0 and for the editbox I will set it as 1.
This is how it looks:
QTP Object properties
So if I need to access the static text then I will do so as follows:
WinObject(“text:=Agent Name:”, index:=0) – This will refer to the static text
WinObject(“text:=Agent Name:”, index:=1) – This will refer to Edit box
The same theory applies to Location identifier too except that we will choose the location in the window to determine the numeric value that is applicable to a certain object.
Configuring Object identification properties:
The mandatory, assistive properties and ordinal identifiers to be considered for an object of a certain class to be recognized can be configured by using “Tools->Object Identifier”. We can also set the smart identification properties through this window.
The window looks as follows:
QTP Configuring Object identification properties
As can be seen in this above image, the environment can be chosen from the drop-down box. Once that is chosen the classes of objects in the corresponding environments are shown in the list. After an object is selected, the mandatory and assistive properties are displayed. The user can Add/Remove additional properties to this list.
Also smart identification can be enabled/disabled for a certain class of object when needed. To set the ordinal identifier there is a drop-down that can be chosen to identify the object using Location, Index or Creation Time (only for browser type only).
QTP Test objects
As you can see, the static text and the edit boxes have the same ‘text’ property.
If I know that one of them is a static text and the other is WinEdit object, then there is no problem at all. Say if all these are treated as WinObject then I will have to specify which object to act on. This is only going to happen when the mandatory, assistive and smart identification have failed. So in order to tell QTP which is what, I am going to assign an ‘Index’ ordinal identifier. I will do so from the OR.
QTP Ordinal Identifier
I will set the Agent name static text identifier as 0 and for the editbox I will set it as 1.
This is how it looks:
QTP Object properties
So if I need to access the static text then I will do so as follows:
WinObject(“text:=Agent Name:”, index:=0) – This will refer to the static text
WinObject(“text:=Agent Name:”, index:=1) – This will refer to Edit box
The same theory applies to Location identifier too except that we will choose the location in the window to determine the numeric value that is applicable to a certain object.
Configuring Object identification properties:
The mandatory, assistive properties and ordinal identifiers to be considered for an object of a certain class to be recognized can be configured by using “Tools->Object Identifier”. We can also set the smart identification properties through this window.
The window looks as follows:
QTP Configuring Object identification properties
As can be seen in this above image, the environment can be chosen from the drop-down box. Once that is chosen the classes of objects in the corresponding environments are shown in the list. After an object is selected, the mandatory and assistive properties are displayed. The user can Add/Remove additional properties to this list.
Also smart identification can be enabled/disabled for a certain class of object when needed. To set the ordinal identifier there is a drop-down that can be chosen to identify the object using Location, Index or Creation Time (only for browser type only).