cancel
Showing results for 
Search instead for 
Did you mean: 

modifying test Description using groovy

sanj
Super Contributor

modifying test Description using groovy

Is there any way I can modify test case Description using grovy script

 

3 REPLIES 3
jhanzeb1
Frequent Contributor

Re: modifying test Description using groovy

Hi Sanj,

 

You can update TC description by using the script below:

For an individual test case

step.setDescription('This is the description')

 If you have a SOAP Request, use the script below

context.testCase.getTestStepList().each {
	def step = it
	step.setDescription('SOAP Request description')
}

 For REST request, you can use this

context.testCase.getTestStepList().each {
	if (it instanceof com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep){
		it.getTestRequest().setDescription('REST Description')
	}
}

 Once you have set these, you can log to see the description by using the script below:

 

log.info testRunner.testCase.description

 

I hope this helps 🙂

 

Olga_T
Moderator

Re: modifying test Description using groovy

Hi all,

 

@jhanzeb1, great instructions!

@sanj, was the reply above helpful?

 

 


Olga Terentieva
SmartBear Assistant Community Manager

sanj
Super Contributor

Re: modifying test Description using groovy

I was looking at how I could modify the test case and not the test step description.

I dont see that in the groovy steps

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