Forum Discussion

rajforu2k6's avatar
rajforu2k6
Occasional Contributor
11 years ago
Solved

WaitChild method - ChildName input : Does this ChildName as input should be direct child object of parent object or can it be any child object in that object hierarchy. Please advise.

Also, Noticed that below statement is executed correctly by Testcomplete without any errors and it is waiting for specified time-out period irrespective of whatever the childname is. Can anyone please explain this ? Observed similar behaviour with WaitWPFObject method also.



if (ContentPane.WaitChild("raj",20000).Exists)

{

    // code

}



Regards,

Raj
  • that sounds right to me. if "raj" does not exist it will wait 20 seconds and then NOT enter the "if".



    What do you expect to occur?



    It needs to be a direct child so if the alias is:



    appObject.ContentPane.control.raj



    then your "if" would never be true.



    it would need to be



    appObject.ContentPane.raj



    and then of course be loaded :)



    You can setup aliases to objects any way you like so if "raj" as a mapped object is this:



    appObject.ContentPane.control.raj



    you can setup an alias for it to be:



    appObject.ContentPane.raj

2 Replies

  • maximojo's avatar
    maximojo
    Frequent Contributor
    that sounds right to me. if "raj" does not exist it will wait 20 seconds and then NOT enter the "if".



    What do you expect to occur?



    It needs to be a direct child so if the alias is:



    appObject.ContentPane.control.raj



    then your "if" would never be true.



    it would need to be



    appObject.ContentPane.raj



    and then of course be loaded :)



    You can setup aliases to objects any way you like so if "raj" as a mapped object is this:



    appObject.ContentPane.control.raj



    you can setup an alias for it to be:



    appObject.ContentPane.raj
  • rajforu2k6's avatar
    rajforu2k6
    Occasional Contributor
    Hi Mark,



    Thanks for your time.



    I am new to the TestComplete and trying to understand how Wait methods works. In TestComplete documentation website it doesn't clearly mention whether Child name should be direct child object or not.



    I have mapped the object and created Aliases; and by using WaitAliasChild method solved my purpose.



    Regards,

    Raj