Micro Focus QTP (UFT) Forums
Childobject return wrong checkbox count.. - 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: Childobject return wrong checkbox count.. (/Thread-Childobject-return-wrong-checkbox-count)



Childobject return wrong checkbox count.. - VpnQTP - 04-08-2015

Hi,

I am passing problem to get count of check box available on my Gmail inbox.
My QTP script return Zero "0" count.
I am using UFT 11.5 and IE10,11.
So far here is the only code i have.

Code:
Systemutil.CloseProcessByName "iexplore.exe"
Systemutil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "https://www.gmail.com/intl/en/mail/help/about.html"
Browser("name:=Gmail - Free Storage and Email from Google").Page("title:=Gmail - Free Storage and Email from Google").Link("name:=Sign in").Click
Browser("name:=Gmail").Page("title:=Gmail").WebEdit("html id:=Email").Set "XXXXX@gmail.com"
Browser("name:=Gmail").Page("title:=Gmail").WebEdit("html id:=Passwd").Set "***"
Browser("name:=Gmail").Page("title:=Gmail").WebButton("html id:=signIn").Click

Dim oDesc,Cbox
Set Cbox =Description.Create()
Cbox("micclass").Value="Webcheckbox"
Set  oDesc=Browser("title:=Gmail").Page("url:=https://mail.google.com/mail/#inbox").ChildObjects(Cbox)

Msgbox oDesc.Count       "Return Zero checkbox count"
Dim i
For i = o To oDesc.Count-1
    oDesc(i).Set "ON"
Next

Any help would be appreciated.

Thanks,
Vipin


RE: Childobject return wrong checkbox count.. - babu123 - 04-09-2015

Can you Check like this...

Code:
Dim oDesc,Cbox
Set Cbox =Description.Create()
Cbox("micclass").Value="Webcheckbox"
Set  oDesc=Browser("title:=.*").Page("url:=.*").ChildObjects(Cbox)

Msgbox oDesc.Count      

For i = o To oDesc.Count-1
    oDesc(i).Set "ON"
Next