Ask a Question

How to retrieve the Test Suite and Test Case labels within a groovy script

mermet
Occasional Contributor

How to retrieve the Test Suite and Test Case labels within a groovy script

Hi, I would like to create some log (using log4j Logger) of my Test activity. For that I need to be able to retrieve the Test Suite ad Test Cases labels from within a groovy script.  I have looked at the javadoc of the WsdlTestCaseRunner and WsdlTestRunContext and have found nothing.

Is there a way to retrieve that Information ?

Thanks.
4 REPLIES 4
omatzura
Super Contributor

Hi mermet,

sure.. try using the following to print them..

log.info( testRunner.testCase.name + " in " + testRunner.testCase.testSuite )

Hope this helps!

regards,

/Ole
eviware.com
mermet
Occasional Contributor

Hi Ole, this produces the following output:


Sun Dec 30 10:04:14 CET 2007:INFO:Initialisation Test Case in com.eviware.soapui.impl.wsdl.WsdlTestSuite@e62df

Gives at least the correct Test Case name under soapUI 1.7.6. I'll give a try with soapUI 2.0...

Thanks.
omatzura
Super Contributor

Hi!

sorry, it should have been

log.info( testRunner.testCase.name + " in " + testRunner.testCase.testSuite.name )

regards,

/Ole
eviware.com
mermet
Occasional Contributor

Hi, works new with testRunner.testCase.testSuite.name.

Thanks a lot !
cancel
Showing results for 
Search instead for 
Did you mean: