Skip to content

Instantly share code, notes, and snippets.

@gauravkhuraana
Last active September 27, 2017 09:44
Show Gist options
  • Save gauravkhuraana/306fb5ccadbfba5237e8ed15d060d64a to your computer and use it in GitHub Desktop.
Save gauravkhuraana/306fb5ccadbfba5237e8ed15d060d64a to your computer and use it in GitHub Desktop.
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