SOAPUI - SOAPRequest - 扩展属性以访问当前 TestStep 的名称属性 [英] SOAPUI - SOAPRequest - Expand properties to access name property of current TestStep

查看:40
本文介绍了SOAPUI - SOAPRequest - 扩展属性以访问当前 TestStep 的名称属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SoapUI 提供了一种通用语法来在 SOAP 请求中动态插入属性.在他们的 文档 中,他们解释了如何根据属性范围访问不同的属性:

SoapUI provides a common syntax to dynamically insert properties in SOAP Request. In their documentation they explain how to access different properties depends on property scope:

#Project# - references a Project property
#TestSuite# - references a TestSuite property in the containing TestSuite
#TestCase# - references a TestCase property in the containing TestCase
#MockService# - references a MockService property in the containing MockService
#Global# - references a global property (optional)
#System# - references a system property
#Env# - references a environment variable
[TestStep name]# - references a TestStep property within the current TestCase

我的问题是我想访问当前 testStep 的名称,但是文档说要访问 TestStep 属性,您需要名称...还有另一种方法吗?例如#TestCase#TestStep#Name.我知道如何使用 groovy 脚本实现这一点,但在我的情况下,我想将该属性直接放在 SOAP 请求上.

My problem is I want to access the name of the current testStep however documentation says that to access TestStep properties you need the name... There is another way to do so? like for example #TestCase#TestStep#Name. I know how to achieve this with groovy script but in my case I want to put the property directly on SOAP Request.

提前致谢

推荐答案

最后我在 文档,使用 '=' 前缀可以指定一个 groovy 脚本并访问一些上下文变量.在这种情况下,request 变量和它的 name 属性都是可用的,因此可以通过以下方式访问当前的 TestStep 名称:

Finally I found the solution in the documentation, with '=' prefix it's possible to specify a groovy script and access to some context variables. In this context request variable is available and also its name property, so It's possible access to the current TestStep name with:

${=request.name}

这篇关于SOAPUI - SOAPRequest - 扩展属性以访问当前 TestStep 的名称属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆