Micro Focus QTP (UFT) Forums
problem with childObjects - 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: problem with childObjects (/Thread-problem-with-childObjects)



problem with childObjects - hadar - 03-27-2012

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



RE: problem with childObjects - sshukla12 - 03-27-2012

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


RE: problem with childObjects - hadar - 03-27-2012

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


RE: problem with childObjects - sshukla12 - 03-27-2012

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


RE: problem with childObjects - hadar - 03-28-2012

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


RE: problem with childObjects - sshukla12 - 04-02-2012

Hi,

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

Regards,
Sankalp


RE: problem with childObjects - hadar - 04-02-2012

Hi,

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


RE: problem with childObjects - sshukla12 - 04-02-2012

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