Ask a Question

property expansion in mocked responses

btmuc
New Contributor

property expansion in mocked responses

Hello,

after having read

http://www.soapui.org/Getting-Started/m ... ponse.html

I tried to use property expansion like ${#TestCase#TransactionId} for a mocked response. This test case property has been set in the test case' setup script and successfully referenced in a SOAP request test step. But for the mocked response this expression yields an empty string.

So my question:

Is property expansion possible in the same way as for SOAP request steps, e.g. using ${#TestCase#TransactionId}? Or is it only possible to use 'simple' properties like ${TransactionId}?

Thanks in advance

M
3 REPLIES 3
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi!

no, this should work.. do you mean a mocked response in a MockResponse TestStep?

regards!

/Ole
eviware.com

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
btmuc
New Contributor

Hi Ole,

yes, I'm talking about SOAP Mock Response test steps.

I've just double-checked:

Putting

<cus:TransactionId>${#TestCase#TransactionId}</cus:TransactionId>

in the XML of the response of a Mock Response test step yields

<cus:TransactionId></cus:TransactionId>

As a work-around I've used this line in the script of the Mock Response test step

context.setProperty('TransactionId',context.testCase.getPropertyValue('TransactionId'))

and modified the above XML code to

<cus:TransactionId>${TransactionId}</cus:TransactionId>

This yields

<cus:TransactionId>D0780100027579</cus:TransactionId>

Thus I know that the test case property 'TransactionId' has been properly set.

Perhaps I've hit a bug. I'm using 3.6.1 Open Source Edition.

Cheers

M
HeikoStudt
Occasional Contributor

I had the same problem in SoapUI 5.1.2

 

MFG (Best Regards)

Heiko Studt

cancel
Showing results for 
Search instead for 
Did you mean: