如何从 SoapUI 中的 soap 请求中引用测试用例名称

How to refer to test case name from soap request in SoapUI

我正在寻找一种方法来使用当前测试 case/test 步骤名称作为我请求的其中一个属性中的值 xml。

有人知道语法吗?我查阅了 SoapUI 文档,但找不到任何内容

我正在寻找类似

的东西

${#TestCase#TestStep#Label}

测试用例名称

以下是如何使用 属性 扩展在 test request 步骤中获取 测试用例名称
${=testCase.name}

所以,例子可以是

<testCaseName>${=testCase.name}</testCaseName>

如果要在Groovy Script步中使用,则使用
log.info "test case name is : ${context.testCase.name}"

测试步骤名称

为了获取测试步骤名称,就像已经提到的albciff,您可以在test request.
中使用相同的${=request.name} PS:归功于 albciff,仅在此处添加以使其完整。

还有另一种方法是使用 ${=context.currentStep.name}.

因此,示例可以是:

<testStepName>${=context.currentStep.name}</testStepName>

<testStepName>${=request.name}</testStepName>

如果步骤类型是Groovy Script,可以使用

log.info "Current step name is : ${context.currentStep.name}"