Forum Discussion

stacey_williams's avatar
stacey_williams
New Contributor
11 years ago

Checking window status in Test Complete

I have two problems I've been tasked with solving in Test Complete:



1. Find a way to figure out whether a window whose content takes highly variable amounts of time to load has finished loading yet (so that the next test action is executed on the correct object within the window, which can only be ensured by having everything loaded already).



2. Figure out whether that same very finicky window has closed or not, so that the next test action (on another window which will regain focus as soon as the window in question finally closes) can be executed on the correct object without interference or timeout.



While I was able to figure out the second problem using a strategically placed While Loop with a delay, I'm thinking there must be a way to take care of both problems effectively and much more neatly by sending some sort of message to check the status of the window (e.g. processing, idle, ready) and act based on that. I've been fiddling around with various methods, but haven't found the right one yet. Any thoughts?



I'm using TestComplete 10, currently using keyword tests but open to JScript if that's more expedient.