Forum Discussion
deepesh_jain
15 years agoFrequent Contributor
ABCDEFG wrote: I am new to Groovy and using packages/classes from -http://www.soapui.org/apidocs/overview-summary.html
can someone help me to write a code piece in groovy for below thing-
Need to get Test step name and display it using msg box and using that i need to update another test step.
Appreciate your help in advance!
^Thanks
This would depend on what is the location of test step. Do you want to display/log the name of the test step of the groovy script or another test step?
In either case, follow this technique:
def proj = testRunner.testCase.testSuite.project ;
def tsuite = testRunner.testCase.testSuite ;
def tcase = testRunner.testCase ;
log.info "Current Test Step is = ${tcase.getTestStepAt(2).getName()}"; //This will return the name of test step at index 2.
log.info "Current Test Step is = ${tcase.getTestStepByName("Step_Name").getName()}"; //This will return the name of the indicated test step