Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child objects - Error while retrieving name
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
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.
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
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
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks it's working.can we use for each loop for the same

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SwfTreeview - Color validation for child item YogeshCallappa 0 2,290 11-10-2016, 04:55 PM
Last Post: YogeshCallappa
  Driver Script to control child scripts sumanhyd 1 3,180 07-26-2016, 07:06 PM
Last Post: Ankesh
  UFT 12.50 unable to recognize child objects from a Dialog Class in Firefox jesusisaac 1 3,801 08-20-2015, 11:39 PM
Last Post: ADITI1992
  Child object shwetakondekar 0 2,134 07-01-2015, 03:28 PM
Last Post: shwetakondekar
  How to write a script for fly out menus (Parent - Child - Sub Child) rajkumarsm 3 4,708 09-02-2014, 10:01 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)