cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
ahabib
Occasional Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions
msiadak
Community Hero

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

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. 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!

View solution in original post

4 REPLIES 4
msiadak
Community Hero

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

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. 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!

View solution in original post

ahabib
Occasional Contributor

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

greetings, 

 

thank you  msiadal i found another way to do it

msiadak
Community Hero

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

@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. 🙂 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
ahabib
Occasional Contributor

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

Greetings, 

 

i just added an assertion whenever i want to run the testStep. 

the script : 

import com.eviware.soapui.support.types.StringToObjectMap
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner

def Runner = new WsdlTestCaseRunner(messageExchange.modelItem.testStep.testCase, new StringToObjectMap())
yourTestStep= messageExchange.modelItem.testStep.testCase.testSuite.project.testSuites["hDeliveries"].testCases["delete"].testSteps["deleteAll"]
yourTestStep.run(Runner,context)

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors