如何将变量值传递给 Katalon Studio Rest API 中的 json 路径
How to pass variable value to json Path in Katalon Studio Rest API
//从响应中获取策略 ID
def slurper = new groovy.json.JsonSlurper()
def result = slurper.parseText(response.getResponseBodyContent())
def result_value = result.PolicyID
GlobalVariable.Policyid = result_value
//现在想在 Verificaton 上使用 Policy ID
WS.verifyElementPropertyValue(res, 'Hist[0].Gltran.**S-HO1-20-PPHO-3820501**JV-SON-PRE-PPHO-2010-11.Cr', 20)
所以请帮助我如何在验证级别 json 路径中传递变量值
试试
WS.verifyElementPropertyValue(res, GlobalVariable.Policyid, 20)
//从响应中获取策略 ID def slurper = new groovy.json.JsonSlurper()
def result = slurper.parseText(response.getResponseBodyContent())
def result_value = result.PolicyID
GlobalVariable.Policyid = result_value
//现在想在 Verificaton 上使用 Policy ID
WS.verifyElementPropertyValue(res, 'Hist[0].Gltran.**S-HO1-20-PPHO-3820501**JV-SON-PRE-PPHO-2010-11.Cr', 20)
所以请帮助我如何在验证级别 json 路径中传递变量值
试试
WS.verifyElementPropertyValue(res, GlobalVariable.Policyid, 20)