Micro Focus QTP (UFT) Forums
Childobject weird behavior - 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 weird behavior (/Thread-Childobject-weird-behavior)



Childobject weird behavior - jsknight1969 - 02-25-2010

Using childobjects on a web page, I have run into an issue.

I have a datagrid with 1 to 100's of rows with a link in the first column. This link is an ID field, so use DP to search the childobjects for HTML TAG = A, Text = IDNumber. This works perfectly until I return more than about 100 records, at that point DP is unable to find the requested object but there is not an error generated. It just ends execution. I am thinking it's an overflow of some type. Is there a limit to using childobjects or something?

Thoughts?


RE: Childobject weird behavior - Saket - 02-25-2010

Can you paste your lines of statements?


RE: Childobject weird behavior - jsknight1969 - 02-25-2010

Code:
Set cobj = Description.Create()
cobj("text").value = "123456"
cobj("html tag").value = "a|A"
With  Browser(Browserobj).Page(Pageobj)
    set linkarray = .ChildObjects(cobj)   '<===this is the last line executed
    msgbox linkarray.Count   '<=== this returns an error "Object not found"
End with

This code works perfectly with 10 results, just not with 100.


RE: Childobject weird behavior - jsknight1969 - 02-26-2010

This issue turns out to not be an issue at all. It is instead poor development and human error. This issue is caused by the Page object changing, which is the poor development part...why have 2 different pages for the same search results?!?!....then the human error part...I didn't notice the page changed and had not compensated for it in the DP used to get the page object.

The only issue I have now is how slow the DP search gets when I have more objects to deal with. I would expect some, but this can border on unusable since the developers don't use pagination.

I really appreciate the response Saket.


RE: Childobject weird behavior - Saket - 02-26-2010

Not sure what jsknight tries to say here, may be he was replying to some other thread and by mistake it posted here.

regarding your query-I dont see any overflow issue. the problem I felt with the code is when you describing the cobj you have not mentioned class for that
can you try putting the class value as well and see how it goes.


RE: Childobject weird behavior - jsknight1969 - 02-26-2010

What I tried to say in my last post was that the code was not identifying the object because my browser page had changed and the DP I used to set the page was not correct.

However, now that my page is properly identified, and the link object is now found by using DP, the click event does not happen.

Adding the micclass did not help.

I am unsure what to try next. The link click code works if there are just a few results. More than 100, the object is found, but click does not occur and again, no error to troubleshoot.