The code below helps resolve the Object not unique problem in QTP. It highlights all the runtime objects that have the same description.
' Sample usage: Assume that WinButton description is not unique
HighlightAll Dialog("Options").WinButton("Browse")
' Routine that highlights all the objects
Dim Parent, Desc, Props, PropsCount, MaxIndex, i, Objs
If IsEmpty(TestObject.GetTOProperty("parent")) Then
Set Parent = TestObject.GetTOProperty("parent")
Set Props = TestObject.GetTOProperties
Desc(Props(i).Name).Value = Props(i).Value
Set Objs = Parent.ChildObjects(Desc)
No comments:
Post a Comment