Last active
September 27, 2017 09:44
-
-
Save gauravkhuraana/306fb5ccadbfba5237e8ed15d060d64a to your computer and use it in GitHub Desktop.
Groovy Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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