Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code to Identify type of object
#4
Solved: 11 Years, 4 Months ago
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

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.
Reply


Messages In This Thread
code to Identify type of object - by BVVPrasad - 07-24-2010, 01:58 PM
RE: code to Identify type of object - by PrabhatN - 07-27-2010, 05:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Different Type of Dropdown Selector zunebuggy 6 3,430 05-01-2018, 06:46 PM
Last Post: zunebuggy
  Cannot identify the object "Webtable" korunu 1 2,543 06-29-2016, 05:28 PM
Last Post: Ankesh
  Cannot identify the object "Webtable" korunu 0 1,808 05-11-2016, 12:02 AM
Last Post: korunu
  QTP "Cannot identify the object" richardpaulhall_2 3 13,581 08-20-2015, 11:46 PM
Last Post: ADITI1992
  cannot use the type method on object and submit is not working jove1776 5 8,844 01-27-2015, 10:08 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)