Forum Discussion

ssv's avatar
ssv
Occasional Contributor
3 years ago

obj.FindChild takes too long time to search for the child obejct

Hi ,

 

I am working on understanding a failure, that has occured in our system.

 

We have this line:

 

Set objProc = obj.FindChild(PropArray, ValuesArray, 1000, True) ' The obj is the Firefox Browser Page object

 

Further debugging, seems that the FindChild Obj takes too long time to search for the valuesarray, and thats the reason behind the failure.

 

How can I increase the time, for the find child operation to complete

 

 

 

 

2 Replies

  • prasath_2k's avatar
    prasath_2k
    Occasional Contributor

    Hi,

     

    // obj.FindChild(....,1000,True) //

    I could see the depth=1000, is that much depth is required to do FindChild and locate the child object?

    I mean to say, the FindChild operation by itself is heavy and takes up time for execution. Hence calculated(to approximate extend) depth value has to be given for that function.

     

    One option is instead of taking the general parent object(Firefox browser page) you can go for the specific parent(nearest parent) under which your desired object/control is present as child object. This will narrow down the searching. If difficulty is there in doing so as sometime the particular part or control may not be spied, in that case you can go for the overall parent object do find child on that itself.  Else you can go for "Extended find child method" also.

     

    Also, before FindChild, go for a implicit delay methods like wait methods to wait for browser page to load and all controls/objects to get appeared on UI. This will allow time for object browser in TestComplete to load all the parent- child objects associated with the process. Then go for FindChild that might help in locating the particular file without fail.

     

    Hope this helps!

    Cheers

  • Hi ssv - 

     

    It is possible to adjust the autowait timeout for individual operations - please see this document

    specifically related to "autowait - timeout" section. 

     

    Let me know if you have additional questions. 

     

    Emma