SoapUI:使用属性传输传输groovy脚本结果
我在SoapUI是个十足的傻瓜。我正在寻找这个问题的答案,但不知何故,我真的找不到答案 我希望将两个groovy脚本的结果转移到另一个Groovyscript。不幸的是,在使用属性传输时,目标groovy脚本会被源脚本的返回值完全覆盖。我该如何处理这个问题 请在下面找到相同的示例: 如您所见,我想将SoapUI:使用属性传输传输groovy脚本结果,groovy,soapui,Groovy,Soapui,我在SoapUI是个十足的傻瓜。我正在寻找这个问题的答案,但不知何故,我真的找不到答案 我希望将两个groovy脚本的结果转移到另一个Groovyscript。不幸的是,在使用属性传输时,目标groovy脚本会被源脚本的返回值完全覆盖。我该如何处理这个问题 请在下面找到相同的示例: 如您所见,我想将generateCreated和generateOnce的传输结果的值传递到testRunner.testCase.getPropertyValue(“Nonce”)和testRunner.test
generateCreated
和generateOnce
的传输结果的值传递到testRunner.testCase.getPropertyValue(“Nonce”)
和testRunner.testCase.getPropertyValue(“Created”)中的generatePassword
脚本中
但这似乎对我不起作用。你不需要属性转移测试步骤
您只需让前两个脚本运行—就像您已经在做的那样
然后在第三个Groovy脚本中,将结果拉入变量
这可以通过以下方法实现
def result = context.expand( '${Groovy Script#result}' )
def created = context.expand( '${generateCreated#result}' )
def nonce = context.expand( '${generateNonce#result}' )
在你上面的例子中,我怀疑你会将其调整为
def result = context.expand( '${Groovy Script#result}' )
def created = context.expand( '${generateCreated#result}' )
def nonce = context.expand( '${generateNonce#result}' )
在脚本中任何需要这些变量的地方插入这些行,然后让变量“created”和“nonce”保存结果。不需要属性转移测试步骤
您只需让前两个脚本运行—就像您已经在做的那样
然后在第三个Groovy脚本中,将结果拉入变量
这可以通过以下方法实现
def result = context.expand( '${Groovy Script#result}' )
def created = context.expand( '${generateCreated#result}' )
def nonce = context.expand( '${generateNonce#result}' )
在你上面的例子中,我怀疑你会将其调整为
def result = context.expand( '${Groovy Script#result}' )
def created = context.expand( '${generateCreated#result}' )
def nonce = context.expand( '${generateNonce#result}' )
在脚本中需要这些变量的地方插入这些行,然后让变量“created”和“nonce”保存结果