Forum Discussion

RonT's avatar
Occasional Contributor
3 years ago

GeneralEvents_OnTimeout doesn't execute

Test Complete 12.6

Web testing

100% VBScript

My suites are ALL built as ONE project per suite

We have no Admin access to our DoD systems

This version (12.6) is the only one on the install-able list.


I've started running all of our projects using command line parameters from scheduled Power Shell scripts.


The .ps1 scripts start Test Complete as follows:

$process = Start-Process -Wait -PassThru -filepath `"$global:tcpath`" -ArgumentList `"$global:projpath$global:app`", $global:timeout, $global:indexstart, $global:indexend, $global:indexstep, "/run", "/exit"


The parameters look (in general) like this:

     $global:tcpath = "C:\Program Files (x86)\SmartBear\TestComplete 12\x64\Bin\TestComplete.exe"
     $global:app = "PXC_QUES\PXC_QUES.pjs"

     $global:timeout = "/timeout:900" #15 minutes

     $global:indexstart = "STARTHERE=1"

     $global:indexend = "ENDHERE=4"
     $global:indexstep = "STEPHERE=1"

and when the project runs, it is compliant to the /timeout value, that is, if the test runs longer than 15 minutes, Test Complete will stop with a timeout error and return the appropriate return code of 4.


The issue is that GeneralEvents_OnTimeout never executes when the test times out.


Sub GeneralEvents_OnTimeout(Sender, Params)
  Call aqFile.WriteToTextFile(TCID_email, "----- GeneralEvent OnTimeout", aqFile.ctANSI, False)
End Sub


This means I don't terminate the browser, and this causes the Power Shell script to hang because the -Wait parameter is waiting for the child process (browser) to complete.


I have Stop on Error UNchecked (i've tries it both ways).

I have all my GeneralEvents in their own Unit_LIB_GeneralEvents file, and that unit is included ('USEUNIT) in every other unit, so it should be reachable.


I suspect I've missed something fundamental, but find no hints in previous posts, nor the "Handling Events TestComplete Documentation"


Additionally I've tried the following, and none of these execute either. I would expect OnStartTest to run when the test starts, but I never get the message in the email file from any of these.


Sub GeneralEvents_OnStartTest(Sender)
  Call aqFile.WriteToTextFile(TCID_email, "----- GeneralEvent OnStartTest", aqFile.ctANSI, False)
End Sub
Sub GeneralEvents_OnStopTest(Sender)
  Call aqFile.WriteToTextFile(TCID_email, "----- GeneralEvent OnStopTest", aqFile.ctANSI, False)
End Sub

Sub GeneralEvents_OnLogError(Sender)
  Call aqFile.WriteToTextFile(TCID_email, "----- GeneralEvent OnLogError", aqFile.ctANSI, False)
End Sub


Thanks in advance for any advice.










  • Sorry you aren't able to keep up.  You can always contact Support and see if there's a bug fix that they are willing to port to an earlier version.

6 Replies