Forum Discussion

DanielM75's avatar
DanielM75
Occasional Contributor
4 years ago
Solved

Waiting for onscreen message to disappear

Hello We are testing a desktop application. When changing forms on the application, loading up a customer etc, the desktop app with display a message on the bottom left of the application screen. ...
  • Wamboo's avatar
    4 years ago

    Hi,

     

    If You are sure that this object actually exists on-screen You can use this function for example:

     

    function waitUntilExist(o, count) {
      var count = count || 60;
      for (var i = 1; i <= count; i++) {
        if (o.Exists == true) {
          aqUtils.Delay(1000);
        } else {
          break;
        }
      }
    }

    But this will only work for You If .exist is available. Or try to create some kind of do() while {}.

  • tristaanogre's avatar
    tristaanogre
    4 years ago

    DanielM75 wrote:

    Thanks Wamboo

    But unfortunately the message isn't an obect that can be obtained via object spy, not is it in its own text box or similar.

    Otherwise it would be a lot easier.

     


    Any object can be found somewhere as an object.  If it's part of the application that generates a UI, it's there somewhere.

     

    As a minor correction to Wamboo , though.  I would not use just strict "Exists" of the object "o".  If "o" stops existing, calling "Exists" on it will generate an error that the object no longer exists.  I would pass in to that function not the object but the object name or property set or something and use something like "FindChildEx" to find the object in a loop.