07-27-2010, 05:50 PM
Hi Prasad,
You can try the following piece of code. But before trying make sure that all the properties are present that are being used over here. Or you can change it according to your application
Then from QTP call the function as follows:
Hope it will serve to your need.
You can try the following piece of code. But before trying make sure that all the properties are present that are being used over here. Or you can change it according to your application
Code:
Function returnObjClass(ByVal windName,ByVal objName)
Set obj = Description.Create
obj("name").Value = objName //make sure "name" property is present for the object
Set allObj = Window("regexpwndtitle:="&windName).ChildObjects(obj)
If allObj.Count > 1 Then
msgbox "More than one Object found having this property"
End If
returnObjClass = allObj(0).GetROProperty("Class Name")
End Function
Then from QTP call the function as follows:
Code:
getClassName = returnObjClass("Your Window Name","Your Object Name")
msgbox getClassName
Hope it will serve to your need.