我是SoapUI中的绝对菜鸟。我正在寻找答案,但不知何故找不到它。
我处于这样一种情况,我想将两个groovy脚本的结果转移到另一个Groovyscript。不幸的是,在使用Property Transfer时,目标groovy脚本会被源脚本的返回值完全覆盖。我该如何处理?
正如您所看到的,我想将generateCreated
和generateNonce
的转移结果的值传递给generatePassword
和testRunner.testCase.getPropertyValue("Nonce")
中的testRunner.testCase.getPropertyValue("Created")
脚本但是这似乎对我不起作用。
您不需要Property Transfer测试步骤。
您只需让前两个脚本运行 - 就像您现在所做的那样。
然后在你的第三个Groovy脚本中,你只需将结果拉入变量。
这可以使用类似的东西来完成
def result = context.expand( '${Groovy Script#result}' )
在你的情况下,我怀疑你会调整到类似的东西
def created = context.expand( '${generateCreated#result}' )
def nonce = context.expand( '${generateNonce#result}' )
在需要这些变量的情况下在脚本中插入这些行,然后使用变量“created”和“nonce”来保存结果。