vlad230
13 years agoContributor
WaitWindow() issues
Hi guys,
I'm encountering some issues with the WaitWindow() function from TestComplete 9.
I have built a function that waits until a window is displayed using WaitWindow() but the problem is that sometimes it doesn't work - the window appears on screen but TestComplete still waits for it.
Here's my code:
Any thoughts on this?
Thanks,
Sergiu
I'm encountering some issues with the WaitWindow() function from TestComplete 9.
I have built a function that waits until a window is displayed using WaitWindow() but the problem is that sometimes it doesn't work - the window appears on screen but TestComplete still waits for it.
Here's my code:
function WaitforWindow(process, WndClass, WndCaption){
var p, w, i;
i = 0;
p = Sys.Process(process);
while(1){
w = p.WaitWindow(WndClass, WndCaption, -1, 5000);
i = i + 1;
if ( (w.Exists && w.VisibleOnScreen) || (i > 20) )
break;
}
if (! (w.Exists && w.VisibleOnScreen))
Log.Error("Window not found.");
else
Log.Message("Window was found.");
return w;
}
Any thoughts on this?
Thanks,
Sergiu