Eviware Forum

soapUI => soapUI => Topic started by: mermet on December 07, 2007, 07:02:47 pm



Title: How to share data between Test Cases belonging to the same Test Suite
Post by: mermet on December 07, 2007, 07:02:47 pm
Hi,  I want to share data between all Test Cases that are in my Test Suite.
I just found out that the scope of Context properties are only for the Test Case.

Properties can be read from file (or Database I suppose), but I want to share pre-processed data between Test Cases. Not only data directly accessed from a File.

For instance my Test Suite includes an initialisation Test Case that is responsible to prepare some list (or even things like myXML). I want to have those data to be available for each Test Case so they can be used in Groovy script to set the requests for instance.

How can this be achieved ?
Thanks a lot.


Title: Re: How to share data between Test Cases belonging to the same Test Suite
Post by: omatzura on December 07, 2007, 08:24:55 pm
Hi mermet,

this is what TestSuite properties are for.. you first TestCase should write the desired value to corresponding TestSuites properties and the following TestCases can read the values from there..

ie do the following:

1) Define the desired properties at the TestSuite level in the TestSuite editor
2) Write the desired values to these properties in your first TestCase, either using a PropertyTransfer or a groovy script;

testRunner.testCase.testSuite.setPropertyValue( .., .. )

3) access these properties in your following testcases with property-transfers, property-expansion or a groovy script..

Hope this makes sense / helps!

regards,

/Ole
eviware.com


Title: Re: How to share data between Test Cases belonging to the same Test Suite
Post by: mermet on December 10, 2007, 10:46:49 am
Thanks a lot. Makes a great sense, but I can't find the way to define new Test Suite Properties. I can see the Test Suite properties pane, but it seems to be read only
(there is a single property which is the name of the Test Suite).
The Test Suite Editor does not provide any facility either to create new properties.
I have soapUI Pro v.1.7.6.

Sorry but I'm very frustrated !


Title: Re: How to share data between Test Cases belonging to the same Test Suite
Post by: mermet on December 10, 2007, 04:25:08 pm
Found them in version 2.0 beta2 !