Object Identification in QTP

HP QTP object identification gives complete idea about how qtp identify the objects in running and recording the web application under test.

QTP Identify the objects in application as stores objects as test objects and it is has 4 types of object identification those are.

Read Also: Automation Testing Process

  1. Mandatory properties
  2. Assistive properties
  3. Ordinal identifier
  4. Smart Identification

Type 1: Mandatory Properties


While recording for each test objects class,qtp identify a list of mandatory properties to identify objects.

Ex: image,text,html etc

Type 2 : Assistive Properties


HP qtp adds assistive properties until it has compiles a unique description.If mandatory properties are not sufficient then we can go for assistive properties in QTP to identify the objects in application.

Type 3 : Ordinal Identifier


if assistive properties are not sufficient ,QTP uses a special an ordinal identifier types as Index,Location and Creation time of the objects to identify the objects in application.Please find the examples below

Consider three text boxes which is having same properties then in order to identify these three text boxes we can use index property as below

TEXT BOX 1
TEXT BOX 2
TEXT BOX 3

as we can write QTP script as

'Test box 1
Browser("title:=Gmail").Page("title:=Gmail").WebEdit("name:=textb", "index:=0").Set "arajesh"
'Test box 2
Browser("title:=Gmail").Page("title:=Gmail").WebEdit("name:=textb", "index:=1").Set "yyyyyyyy"
'Test box 3
Browser("title:=Gmail").Page("title:=Gmail").WebEdit("name:=textb", "index:=2").Set "xxxxxxx"

Same we will follow for Location and Creation time.

Post a Comment

0 Comments