Micro Focus QTP (UFT) Forums
view child objects - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: view child objects (/Thread-view-child-objects)



view child objects - arun2kindia - 12-19-2008

Hi Ankur,

following is my script to view all the childobjects. "Object doesn't support" error occur in For loop. can you help on this

Code:
Set Obj_Desc=Description.Create
Obj_Desc("html tag").value = "INPUT"

Dim allTextbox, sign

Set allTextbox = Browser("Login").Page("Login").ChildObjects(Obj_Desc)

For each sing in allTextbox
      msgbox sing.Name
Next



RE: view child objects - sreekanth chilam - 12-21-2008

Hi Arun,

Try with below code ...

Code:
Set Obj_Desc=Description.Create
Obj_Desc("html tag").value = "INPUT"

Dim allTextbox
Set allTextbox = Browser("Login").Page("Login").ChildObjects(Obj_Desc)
allTextbox_Cnt=allTextbox.count

For i=0 in (allTextbox_Cnt-1)
  msgbox allTextbox(i).GetRoProperty("Attached Text")
Next

The script will work fine.