Marcky
13 years agoNew Contributor
Make a running test wait for timer tick
Hi,
I was wondering if it was possible to make the test wait for a timer to trigger it's assigned function. (wait for the tick event)
What I want to do is simply call the same function over and over for every X minutes because I need to test something overnight. My problem is how can I prevent the test from stopping when there's no more line of code("actions") to be executed?
Quick example in jscript (script name is MainTestFunctionScript) :
var myTimer;
function MainTestFunctionScript(){
//Setup my new timer
myTimer= Utils.Timers.Add(5000, "MainTestFunctionScript.DoWhatIWant", false);
myTimer.Name = "NotificationTimer";
myTimer.Enabled = true;
//I dont want the test to stop here, I want it to wait for the next timer tick (kind of an infinite timed loop)
//Or is there a way to pause the test for an amount of time? Something like -> test.Pause(5 minutes);
}
function DoWhatIWant(){
//do something cool
}
Thanks!
Marc
I was wondering if it was possible to make the test wait for a timer to trigger it's assigned function. (wait for the tick event)
What I want to do is simply call the same function over and over for every X minutes because I need to test something overnight. My problem is how can I prevent the test from stopping when there's no more line of code("actions") to be executed?
Quick example in jscript (script name is MainTestFunctionScript) :
var myTimer;
function MainTestFunctionScript(){
//Setup my new timer
myTimer= Utils.Timers.Add(5000, "MainTestFunctionScript.DoWhatIWant", false);
myTimer.Name = "NotificationTimer";
myTimer.Enabled = true;
//I dont want the test to stop here, I want it to wait for the next timer tick (kind of an infinite timed loop)
//Or is there a way to pause the test for an amount of time? Something like -> test.Pause(5 minutes);
}
function DoWhatIWant(){
//do something cool
}
Thanks!
Marc