读取SOAP UI Mock服务属性

时间:2016-08-31 08:19:59

标签: groovy mocking soapui

我正在尝试在Script Dispatcher

中读取模拟服务的属性

the property "contatore"

the script where i'm trying to read the property

但我总是错误

  

没有这样的财产[..]

阅读documentationhere

你知道如何存档吗? 感谢

1 个答案:

答案 0 :(得分:0)

为了获得Mock Service的属性,您需要执行以下操作。

在脚本编辑器中,请提供以下代码段:

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