Forum Discussion

ahabib's avatar
ahabib
Occasional Contributor
6 years ago
Solved

How to run a testCase for each a testStep using tearDown script

Im trying to run a testCase (delete) before running any other testCase using tearDown script but i get scriptException: error in teardDown script.

this is the code :

def testStep = testRunner.testCase.testSuite.testCases['delete'].testSteps['deleteAll']
testSuite.getTestCaseList().each{
testStep.prepare(testRunner, context)
testStep.run(testRunner, context)
testStep.finish(testRunner, context)
}

 

any help would be really apperciated.

  • Can you provide the error that you get? That might help with troubleshooting. Also, a teardown script typically runs at the end of something. Maybe you need a setup script that'll run before anything else? Just a thought on that one. But if you can provide the errors that would be super helpful. 

4 Replies

  • groovyguy's avatar
    groovyguy
    Community Hero

    Can you provide the error that you get? That might help with troubleshooting. Also, a teardown script typically runs at the end of something. Maybe you need a setup script that'll run before anything else? Just a thought on that one. But if you can provide the errors that would be super helpful. 

    • ahabib's avatar
      ahabib
      Occasional Contributor

      greetings, 

       

      thank you  msiadal i found another way to do it

      • groovyguy's avatar
        groovyguy
        Community Hero

        ahabib: Can you post details of how you solved it? That way the solution is evident for anyone else who may come here looking for similar results. :)