Forum Discussion

sanj's avatar
sanj
Super Contributor
6 years ago

modifying test Description using groovy

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

 

3 Replies

  • jhanzeb1's avatar
    jhanzeb1
    Frequent Contributor

    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's avatar
      Olga_T
      SmartBear Alumni (Retired)

      Hi all,

       

      jhanzeb1, great instructions!

      sanj, was the reply above helpful?

       

       

      • sanj's avatar
        sanj
        Super Contributor

        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