通过使用 groovy 脚本,本地 属性 值不会在 SOAP UI 中更新
By using groovy scripts local property value is not updated in SOAP UI
我在下面编写了 groovy 脚本来更新属性选项卡中的本地测试用例 属性 值:
String testString = "TestString"
testRunner.testCase.setPropertyValue( "Pro_Response", testString )
def getLocalPropValue = testRunner.testCase.getPropertyValue("Pro_Response")
log.info(getLocalPropValue)
所以在 运行 这个 groovy 脚本之后,我的预期输出是 Pro_Response 属性 应该用 testString 值更新。但这并没有发生。
注意:groovy log.info(getLocalPropValue) 在脚本输出中给我 testString 值没有问题。
任何人都可以建议
我找到了以下解决此问题的方法:
由于我想修改属性测试步骤中的 属性:
我需要修改以下现有代码行:
testRunner.testCase.setPropertyValue("Pro_Response", 测试字符串)
如下所示:
testRunner.testCase.testSteps["Properties_2"].setPropertyValue( "Pro_Response", testString )
我在下面编写了 groovy 脚本来更新属性选项卡中的本地测试用例 属性 值:
String testString = "TestString"
testRunner.testCase.setPropertyValue( "Pro_Response", testString )
def getLocalPropValue = testRunner.testCase.getPropertyValue("Pro_Response")
log.info(getLocalPropValue)
所以在 运行 这个 groovy 脚本之后,我的预期输出是 Pro_Response 属性 应该用 testString 值更新。但这并没有发生。
注意:groovy log.info(getLocalPropValue) 在脚本输出中给我 testString 值没有问题。
任何人都可以建议
我找到了以下解决此问题的方法: 由于我想修改属性测试步骤中的 属性:
我需要修改以下现有代码行:
testRunner.testCase.setPropertyValue("Pro_Response", 测试字符串)
如下所示:
testRunner.testCase.testSteps["Properties_2"].setPropertyValue( "Pro_Response", testString )