I came across some situations (twice in one day, and I see they will not be rare) when test can run infinite time.
Like there is a wait realisation for some account operation but there is an error message displayed over progress bar which is not known by autotest. Message is not closed, progressbar is still on, test is running, running...
And there is another chance to get infinite execution is when UFT failes and displayes error message (which could not be handled by UFT itself), e.g.:
There is some information about the question I've found:
I suppose that (because of no multithreading in UFT's VBScript) there is no possibility to set limit test execution time with the means of UFT (some proof found in post time limit for QTP script\'s execution).
Possible solution is to start test & timeout to kill UFT process at once in the .bat file
Bat-file to start test
start "TestExecutionTimer" "C:\_qtp\resources\testexectimer.bat" [max exec time in seconds] cscript.exe "C:\_qtp\resources\RunTest.vbs" "[path to test]"
Bat-file with UFT process killer
timeout /t %~1 taskkill /im UFTPro.exe exit
And part of
RunTest.vbs VBScript that runs test (it should kill timer if test is completed):
... 'kill timer which is used to close test that runs too long Wscript.Echo "kill timer" oShell.Run "taskkill /fi ""WINDOWTITLE eq testexectimer*"" /f /t", , True Wscript.Echo "timer is killed"
So architecture would look like this:
Does anyone use better solutions?