Archive for March 21, 2009
ActionTemplate
If you wanna create ActionTemplate, so follow below steps.
Step 1: open a Text document & give the required test script header contents as given below
‘**************************************************************
‘PROJECT NAME :
‘CURRENT VERSION :
‘SCRIPT NAME :
‘DESCRIPTION :
‘PRE – CONDITIONS :
‘INPUT DATA SHEET/FILE :
‘FEATURES TO BE TESTED :
‘REUSABLE ACTIONS USED :
‘REUSABLE FUNCTIONS USED :
‘CREATED DATE :
‘AUTHOR/TEAM :
‘’*************************************************************
‘REVIEW HISTORY :
‘’*************************************************************
‘REVIEWED BY :
‘REVIEWED ON :
‘LAST MODIFIED DATE :
‘’*************************************************************
Step 2: Save the file as “ActionTemplate.mst” & choose “All files” under “Save As Type” dropdown list in the “Dat” folder as given in below path.
C:\Program Files\Mercury Interactive\QTP\Dat
Now onwards whenever we create “new test” in qtp then automatically/implicitly the above test script header will added to the test script.
thanks & regards,
Baba Fakruddin.D
ChildObjects
ChildObjects:Returns the collection of child objects contained within the object.
ChildObjects returns similar type of objects which matches with the properties given in Description of Object… under the parent object
e.g. on google.com,
‘systemutil.Run “www.google.com”
clas=inputbox(“Enter your object class”,”Object Class”,”Link”)msgbox clas
Dim obj
Set obj=description.Create
obj(“micclass”).value=clas
set co=browser(“Google”).Page(“Google”).ChildObjects(obj)
msgbox co.count
For i=0 to co.count-1 If (clas=”Link”) Then val=co(i).getroproperty(“text”) print val End If
If (clas=”WebEdit”) Then val=co(i).getroproperty(“html tag”) attext=co(i).getroproperty(“attached text”) print attext print val End If
If (clas=”WebButton”) Then val=co(i).getroproperty(“name”) print val End If
If (clas=”WebRadioGroup”) Then val=co(i).getroproperty(“all items”) print val End IfNext
Thanks & Regards
Baba Fakruddin.D