cancel
Showing results for 
Search instead for 
Did you mean: 

Waiting for onscreen message to disappear

SOLVED
Highlighted
Occasional Contributor

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?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Leader

Re: Waiting for onscreen message to disappear

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

View solution in original post

Highlighted
Community Hero

Re: Waiting for onscreen message to disappear


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


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

5 REPLIES 5
Highlighted
Community Leader

Re: Waiting for onscreen message to disappear

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

View solution in original post

Highlighted
Occasional Contributor

Re: Waiting for onscreen message to disappear

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.

 

Highlighted
Community Leader

Re: Waiting for onscreen message to disappear

Try to use ImageRepository instead or enable Text Recognition in TestComplete.

Highlighted
Community Hero

Re: Waiting for onscreen message to disappear


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


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Occasional Contributor

Re: Waiting for onscreen message to disappear

Great thanks you

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!