Micro Focus QTP (UFT) Forums

Full Version: Child objects - Error while retrieving name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is my code...

Code:
Set obj=description.Create
obj("micclass").value="WebEdit"
set Objchld=Browser("OrangeHRM").Page("OrangeHRM").Frame("rightMenu").ChildObjects(obj)
msgbox Objchld.count

For each i in Objchld
i= i.name
Next


whenever i run this code it's displaying childobject count as 11
after that it is showing error as "Object doesn't support this property or method" (For for each loop).Why it's happening? Any help is appreciated.
Try this,

Code:
Set obj=description.Create
obj("micclass").value="WebEdit"
set Objchld=Browser("OrangeHRM").Page("OrangeHRM").Frame("rightMenu").ChildObjects(obj)
msgbox Objchld.count

For i = 0 to Objchld.Count -1
oName= Objchld(i).name
msgbox oName
Next
Thanks it's working.can we use for each loop for the same