Wednesday, August 8, 2012

SOAPUI Properties and Groovy Steps

Losing my mind for how a simple thing was turned into a complicated riddle.


If you do this:

testRunner.testCase.testSuite.setPropertyValue("Hostname", "02B3TEST0004") testRunner.testCase.testSuite.getPropertyValue("Hostname"))

you will set a TestSuite level property:

After a lot of trial and error, I found out that if you want to get/set properties defined in a Properties Test Step, you must do this:

testRunner.testCase.testSteps["Properties"].setPropertyValue( "Hostname", "fanculo" ) testRunner.testCase.testSteps["Properties"].getPropertyValue( "Hostname" ))

very properly undocumented, thank you SmartBear... if this Bear is smart, I wonder the dummy ones...

So now we are ready to implement the DataSources in Groovy by reading a file and setting a property in a GroovyStep

1 comment:

El Douchablo said...
This comment has been removed by the author.