01-28-2014, 11:15 PM
Hi, try this:
Code:
PUBLIC FUNCTION CreateObjDes(ObjectFatherUFT,StrObjectClass,StrObjectProperty,StrObjectPropertyValue)
'Example return one object:
'CreateObjDes (Window("text:=Calculator"),"WinButton","text","9")).Click
'Example for return a array objects
'Set ObjButton= CreateObjDes (Window("text:=Calculator"),"WinButton","","")
'ObjButton(0).Click
Set ObjDesObject=Description.Create()
ObjDesObject("micClass").value= StrObjectClass
Set ObjDesObjectChild=ObjectFatherUFT.ChildObjects(ObjDesObject)
Dim IntCiclo
IntCiclo=0
If strcomp(StrObjectProperty,"") <> 0 Then
For IntCiclo=0 to ObjDesObjectChild.count -1
If strcomp(StrObjectPropertyValue, trim(ObjDesObjectChild(IntCiclo).GetROProperty(StrObjectProperty)))=0 Then
SET CreateObjDes= ObjDesObjectChild(IntCiclo)
End If
Next
Else
SET CreateObjDes= ObjDesObjectChild
End If
END FUNCTION