I don't think there is a safe way to kill the module at start (in the middle) of execution and then continue with other modules in setup/teardown or even testcase/smartfolder.
What you can do is to add a code module to setup/teardown section (as a very first module in section), in which you evaluate your condition and eventually disable all modules in given section. The code to disable all modules in setup section should look like this:
Code: Select all
var curTestCase = (TestCaseNode)TestSuite.CurrentTestContainer;
//your condition
if (iObject.Exists(1000))
{
foreach(TestModuleLeaf module in curTestCase.AllModules)
{
if (module.IsDescendantOfSetupNode())
{
module.Enabled = false;
}
}
}
Hope this helps?