Micro Focus QTP (UFT) Forums

Full Version: problem with childObjects
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am using the childObjects command in my testing.
I encounter problem in some pages that contain large number of objects.
I see that qtp become "not responding" and it return after 5 seconds empty list.

When I run this on different machine (same OS version, same QTP11 version) it works OK.

I encounter the same problem after login to facebook or in ynet.co.il page .

It doesn't help if I add description.

Example for code :
Code:
Set oDesc = Description.Create
oDesc("micclass").Value = "Browser"
Set childs = Desktop.ChildObjects (oDesc)
Set child = childs (0)
print child.toString
Set oDesc = Description.Create
oDesc("micclass").Value = "Page"
Set childs = child.childObjects(oDesc)
Set child = childs(0)
print child.toString
Set childs = child.childObjects
print childs.count
Hi,

Could u please use different variables for 2 description u are creating. Since there are same variables referencing each other in 2 description created.

Regards,
Sankalp
Hi,

This code works on most pages except large pages.
On different machine it does works but if I increase the number of elements in page at some point it stop.

I try with different var names with the same result.

Thanks
Hi,
For ur code:
Code:
Set oDesc = Description.Create
oDesc("micclass").Value = "Page"
Set childs = child.childObjects(oDesc)
Set child = childs(0)
print child.toString
[color=#FF0000]Set childs = child.childObjects[/color]
print childs.count

For the coloured line of code cpould u please specify the description of the child objects u want to store.

Regards,
Sankalp
This is a code I try on facebook page after I login:

print Browser("Facebook").Page("Facebook").Link("Yossi Birenboim").Exist
Code:
Set oDesc = Description.Create
oDesc("micclass").Value = "Link"
oDesc("text").Value = "Yossi Birenboim"
Set childs = Browser("Facebook").Page("Facebook").ChildObjects(oDesc)
Set child = childs(0) ' Cause general run error
print err.number '

The output is :
True
-2147467259
Hi,

Are u trying to get the child objects of a link ,, as per ur code???

Regards,
Sankalp
Hi,

I am trying to run the command childObjects.
With or without description it doesn't work.
Hi,

If u r trying 2 run the child objects command but before that please chk that object on which u r running this command is a parent object. I don't think here link is a parent object.
Please go through qtp help file it will help u.

Regards,
Sankalp