Forum Discussion

DanielM75's avatar
DanielM75
Occasional Contributor
5 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.

e.g. "Loading Customer"

This message will fade out and disappear after a few seconds, i.e. once everything on the form is ready for us.

 

We want to delay trying to read buttons and controls, interacting with the form in any way until after this message fades out completely.  

We would rather not use a set delay timer.

As the window/form exists, I don't see how a wait on the window to exist or similar would be useful.

 

Any ideas how we could accomplish this?

  • 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 {}.


  • 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.  

5 Replies

  • Wamboo's avatar
    Wamboo
    Community Hero

    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 {}.

    • DanielM75's avatar
      DanielM75
      Occasional Contributor

      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.

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        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.