Eomm Eomm - 1 year ago 249
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?

Rao Rao
Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download