Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
5 years ago

WaitAliasChild taking way longer than specified timeout to return exists = false

var sessionPresence = Aliases.browser.pageMain.wndWindowContent.WaitAliasChild("panLogin", ProjectSuite.Variables.TinyWaitTimeout); // 0 represents immediate return.

 

So I have this line of code which is intended to wait for the panel specified by the alias. I then check the Exists property to decide what to do if it is there. TinyWaitTimeout suite variable is set to 200. 

 

When the panel is present, it is found quickly and the sessionPresence is identified as existing and everything is lovely. If the panel is not present, the code delays for WAAAAAY more than TinyWaitTimeout. I tried

 

aqUtils.Delay(ProjectSuite.Variables.TinyWaitTimeout);
var sessionPresence = Aliases.browser.pageMain.wndWindowContent.WaitAliasChild("panLogin", 0); // 0 represents immediate return.

 

for giggles and still that line waits for a very long time.

 

When I set a break point there, and step over the line, the wait is executed perfectly, waits the right amoung of time to give up and return Exists true or false. 

 

This is going to slow my runtime since this line is executed with every single test in my quite large (and getting larger) suite as it has to do with handling a login gone wrong. While I always prioritize stability over run time speed, this one makes no sense. 

 

Does anyone have any idea how to make this Wait execute for the correct time out period? Honeslty, I think I am missing something obvious because I use this kind of technique All The Time.

Thanks

 

 

13 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The problem may not be with the specific panel but with the parent.  Can you confirm that wndWindowContent is available as well?  Because the waiting may not be for  the child object itself but for the parent.

    • vthomeschoolmom's avatar
      vthomeschoolmom
      Super Contributor

      Yes I can confirm that wndWindowContent is present.  This is a very top level element that is pretty much always present. For giggles I stopped the execution of a test at this point in code and confirm with the highlight element that it is present and very quickly identified.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        > Aliases.browser.pageMain.wndWindowContent.WaitAliasChild("panLogin", ProjectSuite.Variables.TinyWaitTimeout);

        > wndWindowContent is present.  This is a very top level element [...]

        This might be the reason depending how panLogin alias is mapped.

        Guessing that if it is mapped using Advanced Find, then TestComplete will drill-down complete objects tree in order to check if the sought for alias exists.

        The more definite and precise identification criteria and search path are defined in NameMapping, the more fast .WaitXXX() method will work.