Forum Discussion
Gadzilla
14 years agoContributor
Hi,
You can also try something like this:
function Smoke_Main()
{
Smoke_TestCase1();
Smoke_TestCase2();
}
function Smoke_TestCase1()
{
try
{
// steps for execution
if(! step_passed)
throw {message: "Can't continue test cases execution"; description: "critical error"}
// steps, which will be executed in case everything works fine.
}
catch(e)
{
Log.Error(e.message, e.description);
}
finally
{
// execute postconditions for the test case
}
}
So you can put all your steps into try..catch block, and thrown an error when you want to finish current test case execution.
You can also try something like this:
function Smoke_Main()
{
Smoke_TestCase1();
Smoke_TestCase2();
}
function Smoke_TestCase1()
{
try
{
// steps for execution
if(! step_passed)
throw {message: "Can't continue test cases execution"; description: "critical error"}
// steps, which will be executed in case everything works fine.
}
catch(e)
{
Log.Error(e.message, e.description);
}
finally
{
// execute postconditions for the test case
}
}
So you can put all your steps into try..catch block, and thrown an error when you want to finish current test case execution.
Related Content
- 6 years agoranujn
- 4 years agobafageeh
- 2 months agoNicolaFilosa_SE
Recent Discussions
- 51 minutes agomarkos