Waiting for a window to close functionality. Jscript or keyword test.
Hi,
I'm fairly new to testcomplete and in need of some help creating a jscript/keyword test, either will work.
Test scenario is:
I click a createprofile btn that opens up a new window.
I add some values to a textfield in the newly opened window and click a create profile btn.
The system then processes the data, and closes the createprofile window when done - This can take up to 45 seconds.
When done processing the data and the profile is created, it returns to the original window.
The functionality i need in testcomplete is following:
when the create profile btn is pressed in the new window, i need to wait untill the window is closed, for a maximum of 45 seconds.
If the create profile window does not exist(closed) i want to proceed with the test.
I've been trying to use:
while("create profile window".Exists)
{
Delay(500);
}
The problem is then, when the window closes, the while loop then throws "Object not fund exception" after waiting the default timeoutvalue.
Anyone has an idea on how to do this?
Best regards
Henrik
Hello denhenp,
Congratulations on your solution :)
I'd like to suggest the following improvent on your script:
if(milisec >= 45000) { Log.Error("Waited 45 sec for the window to close.. Stopping test");
/*Stops the current Test Item*/
Runner.Stop(true); }and then... Setup TC not to stop on error, see http://support.smartbear.com/viewarticle/63574/
Regards,
Leandro de Araújo Souza