How to have a test wait for a window to appear?
Hi
When starting up an application I need to wait for the login window to appear. And then, after that I need to wait for the main window. Etc. TestComplete offers a function that, from it's name and documentation, ought to be just what I need - wait x milliseconds for a window with a given title to appear. Except that it doesn't bother to wait the time I specify. It appears to be waiting 10 seconds regardless of how long I tell it to wait. I've tried all the way up to 5 minutes and it just ignores it.
So, is the only way to get a wait of x seconds to wait over and over in a loop? I've actually got a test project that does exactly this because it was the only way to get it to work - it uses the process returned from calling Run on the TestedApp and calls WaitWinFormsObject on it over and over. But that was in TestComplete 12 and since there's WaitWindow I was hoping that'd be an option. If it is an option, how can I make that work, either using a loop or without? Even with an attempt at a loop, it seems WaitWindow is stopping the test if it doesn't find the window I'm wanting (it doesn't return a stub object as claimed by the documentation). Or should I just ignore WaitWindow and use the method I used in the other test project?
Question:
Is <Mapped window name> the window you're waiting for? If so... that's kind of what I was saying about the implementation of WaitWindow.
If this is the case, the better way of doing what you want is this.
Aliases.<TestedApp>.WaitAliasChild(<Mapped window name>, 30000)If you want to still use WaitWindow, you would need to know it's direct parent. So, the code would be
Aliases.<TestedApp>.<mapped window of parent object>.WaitWindow('*', <insert titel here>, -1, 30000)