user3447603 user3447603 - 1 year ago 144
Groovy Question

Getting values of properties in SoapUI's groovy

I'm pretty new to testing and SoapUI and I've just faced a problem:
I have 2 soap requests from which I transfer data (using PropertyTransfer) to Properties - I can do that and it works fine for me.
But now I would like to take those values in my groovy script (which is next step of my testcase). How to do that? So far, I have found following:


But it doesn't work for me. I guess it's not that Properties. Any tips?

Answer Source

In the Groovy script panel you can right-click and select Get Data, to help you out. You will end up with something like this:

context.expand( '${Properties step#SomeProp}' )

Same thing can also be written as:

testRunner.testCase.testSteps['Properties step'].getPropertyValue("SomeProp")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download