Eviware Forum

soapUI => soapUI => Topic started by: mermet on December 14, 2007, 10:00:00 am



Title: How to retrieve the Test Suite and Test Case labels within a groovy script
Post by: mermet on December 14, 2007, 10:00:00 am
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.


Title: Re: How to retrieve the Test Suite and Test Case labels within a groovy script
Post by: omatzura on December 14, 2007, 10:02:48 am
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


Title: Re: How to retrieve the Test Suite and Test Case labels within a groovy script
Post by: mermet on December 30, 2007, 10:07:59 am
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.


Title: Re: How to retrieve the Test Suite and Test Case labels within a groovy script
Post by: omatzura on December 30, 2007, 12:02:49 pm
Hi!

sorry, it should have been

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

regards,

/Ole
eviware.com


Title: Re: How to retrieve the Test Suite and Test Case labels within a groovy script
Post by: mermet on January 02, 2008, 04:15:24 pm
Hi, works new with testRunner.testCase.testSuite.name.

Thanks a lot !