Eomm Eomm - 3 months ago 19
Groovy Question

Read SOAP UI Mock service properties

I am trying to read a property of a mock service in the

Script Dispatcher


the property "contatore"

the script where i'm trying to read the property

But I get always error


No such property [..]


Reading the documentation and here

Do you know how I can archive that?
Thanks

Rao Rao
Answer

Here is what you need to do in order to get the properties at Mock Service.

In the script editor, have the following code snippet:

//Assuming that you want integer value, otherwise ignore 'as Integer' in below statement
def contatoreValue = context.mockService.getPropertyValue('contatore') as Integer  
assert 1 == contatoreValue