Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Groovy Code
Groovy Script to run a test case steps in SoapUI
YOu can disable all steps apart from the Groovy step and paste the below code
// the below code can help you run your test case by disabling all the steps and only Groovy step is enabled
// run all the steps except current
// Get the current test case name
def tc=testRunner.testCase
// get the current step Name
String ts=testRunner.testCase.getTestStepAt(context.getCurrentStepIndex()).getLabel()
// looping through all steps
for(def tstp in tc.getTestStepList())
{
String testStepName=tstp.getName()
if(! (testStepName.contains(ts))) // Making sure all steps run but not this groovy. Otherwise infinite loop due to recursion
{
log.info "*** Running test step *** " + testStepName
tstp.run(testRunner,context)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment