Karate 空手道自动化:如何从json数据为URL设置动态路径
从功能文件1中,我读取json文件的内容并将其传递给serverpost.FeatureKarate 空手道自动化:如何从json数据为URL设置动态路径,karate,Karate,从功能文件1中,我读取json文件的内容并将其传递给serverpost.Feature feature file 1 * def output = read('output.json') * def result = call read('serverpost.feature') output 在功能文件2中,我试图将路径设置为TC_ID,并从json数据中请求body作为body 但是,我无法使用以下功能设置路径。请协助 功能文件2 Given path '#(TC_ID)' Given
feature file 1
* def output = read('output.json')
* def result = call read('serverpost.feature') output
在功能文件2中,我试图将路径设置为TC_ID,并从json数据中请求body作为body
但是,我无法使用以下功能设置路径。请协助
功能文件2
Given path '#(TC_ID)'
Given url 'http://myappurl.com:8080/mytestapp/Servers/Data/uploadServer/'
And request { some: '#(BODY)' } #### Here i am able to get the BODY data from JSON
When method post
Then status 200
'#(foo)
符号仅适用于JSON、XML或匹配
语句的右侧
请像正常的JS表达式一样使用它:
给定路径TC\u ID
或
给定路径输出。TC_ID
@Sundan这是一个单独的问题,请在继续之前投票并标记为已接受,谢谢。