I developed some SoapUI cases which set a property at the start of each test case by reading the properties from a file. This works fine, I can then access each property (lets say propertyA) by the syntax ${propertyA} in each test request step.
Now I realized that one of the properties is the same for each test case, so I thought I create a testsuite property for that purpose and remove the property definition from the test case property files. First my test cases all failed, cause now 'propertyA' was not known any more, but I figured out that (according to http://www.soapui.org/Scripting-Properties/property-expansion.html) one solution is to replace each reference to propertyA by #testSuite#propertyA.
This is kind of tedious, though, so I thought of creating a groovy script at the beginning of each test case which creates a test case property from the test suite property. According to http://www.soapui.org/Scripting-Properties/tips-a-tricks.html I thought that a script like
def testSuiteProperty = testRunner.testCase.testSuite.getPropertyValue("propertyA")
testRunner.testCase.setPropertyValue("propertyA", testSuiteProperty)
should do the job. And if I log.info the value of testSuiteProperty this gives indeed the desired value, and also if I assign the testCase property to some variable and log.info it, it shows the correct value.
However, in the next test step, propertyA is not known. Just to make sure I tried to use ${#testCase#propertyA} there, but that is also not known. What did I get wrong here?