Michael_Colclou
12 years agoOccasional Contributor
Runner.Stop(true) stops all tests, not just the current test
Hi
I am using test complete 9
I have two simple tests:
function test1()
{
Log.Message("Executing test1");
}
function test2()
{
Log.Message("Executing test2");
}
and a event handling function:
var errorInStartTest = true;
function GeneralEvents_OnStartTest(Sender)
{
if (errorInStartTest)
{
errorInStartTest = false;
Log.Error("Error occurred in OnStartTest, calling Runner.Stop");
Runner.Stop(true);
}
I set up a project suite containing test1 and test2
I am expecting test1 to fail because an error occurs in the OnStartTest event but test2 to run successfully. The Runner.Stop(true) call should stop the execution of the current test: test1 and go onto the next test: test2
What actually happens is test1 run and reports an error but test2 is never executed.
I use the Runner.Stop(true) call in other places and it does stop execution of the current test and go onto the next test, so why isnt it working in this case? Could it be because the call occurs in the OnStartTest event?
thanks
Michael
I am using test complete 9
I have two simple tests:
function test1()
{
Log.Message("Executing test1");
}
function test2()
{
Log.Message("Executing test2");
}
and a event handling function:
var errorInStartTest = true;
function GeneralEvents_OnStartTest(Sender)
{
if (errorInStartTest)
{
errorInStartTest = false;
Log.Error("Error occurred in OnStartTest, calling Runner.Stop");
Runner.Stop(true);
}
I set up a project suite containing test1 and test2
I am expecting test1 to fail because an error occurs in the OnStartTest event but test2 to run successfully. The Runner.Stop(true) call should stop the execution of the current test: test1 and go onto the next test: test2
What actually happens is test1 run and reports an error but test2 is never executed.
I use the Runner.Stop(true) call in other places and it does stop execution of the current test and go onto the next test, so why isnt it working in this case? Could it be because the call occurs in the OnStartTest event?
thanks
Michael