如何在空手道中的请求的字段中参数化字符串的一部分 [英] How to parameterize a part of string in a field of the request in karate

查看:42
本文介绍了如何在空手道中的请求的字段中参数化字符串的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的请求中有一个字段.我不想参数化整个字段.

I have a field in my request .I don't want to parameterize the entire field.

用户":(KGS-ABCDE-GS \ n- \ n)\ n",

"user": "(KGS-ABCDE-GS\n-\n)\n",

上述字段中的文本ABCDE总是需要动态用户进行更新,其余内容无需更改.上述用户字段是我整个请求的一部分.

The text ABCDE in the above field needs to be updated with a dynamic user always.Rest of the content need not be changed.The user field mentioned above is a part of my whole request.

我正在尝试仅进行特定测试以从功能文件中定义的变量中获取值.请让我知道如何完成此操作. * def用户="HELLOUSER" "user":(KGS--GS \ n- \ n)\ n",

I am trying to only make the particular test to fetch a value from a variable defined in the feature file.Could you please let me know how this can be done. *def user = "HELLOUSER" "user": "(KGS--GS\n-\n)\n",

是否需要使用JavaScript或其他方法来实现这一目标?

Is there a need to have a javascript or some other way to achieve this?

推荐答案

请阅读文档: 查看全文

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