I use VideoRecorder as well, but I have never experienced any issues with infinite loops. I don't start the videorecorder in the OnStartTest event though. I manually call a script from my KWTs, since I don't want to always record everything. I use the OnStopTest as a fallback in case I forgot to call the script to stop at the appropriate point of the KWT
I can't help but notice - and this is probably not the casue - that you code will ALWAYS reach if(!VideoRecorder.IsRecording(), since you previous if statement includes "or True", which means your if statement will always equate to true. You may want to change that
My OnStopTest looks like so:
function GeneralEvents_OnStopTest(Sender)
{
if(VideoRecorder.IsRecording())
VideoRecorder.Stop();
}
There are then two differences I can see.
1. I don't use OnStartTest to start my recording. Does that mean it's your OnStartTest that is somehow starting the VideoRecorder again in a loop ?
2. I work in Jscript. Can't see how that would make any difference and how you could test if this is the cause.