Forum Discussion

mkaplan's avatar
mkaplan
Occasional Contributor
12 years ago

How to start and then stop test cases

Hi Everyone,

I have a test case that needs to run steps of other test cases via groovy. Right now, I use testRunner.runTestStep to run individual steps and testRunner.testCase.testSuite.project.testSuites[xxxxx].testCases[xxxxx].run(null, false) to run a whole test case. My issue is that if I want to run a lot of test steps but not the whole test case, i have to tell each test step to run one by one via testRunner.runTestStep and that takes a lot of time and looks sloppy. My question is: is it possible, in groovy, to start a test case with: testRunner.testCase.testSuite.project.testSuites[xxxxx].testCases[xxxxx].run(null, false) and then somehow stop the test case at a certain test case like: testRunner.testCase.testSuite.project.testSuites[xxxxx].testCases[xxxxx].testStep[xxxx].stop(null, false) or something like that?

Thanks,
Michael

1 Reply

  • Instead of running steps one-by-one, why don't you just enable/disable test steps:


    testRunner.testCase.getTestStepByName( "test step name" ).disabled = false // enabled
    testRunner.testCase.getTestStepByName( "test step name" ).disabled = true // disabled


    and then execute the test case.

    Michael Giller
    SmartBear Software