Karate 如何将单个参数传递到单独的要素文件
我已经在下面尝试发送一个参数到单独的功能文件(通过以下方式),但它并没有按预期工作 项目特征Karate 如何将单个参数传递到单独的要素文件,karate,Karate,我已经在下面尝试发送一个参数到单独的功能文件(通过以下方式),但它并没有按预期工作 项目特征 * def id = '55000000005021' * def result = call read('delete_project.feature') Given path 'project', '#(id)' When method DELETE Then status 200 Then match response.status == 'success' 删除\u p
* def id = '55000000005021'
* def result = call read('delete_project.feature')
Given path 'project', '#(id)'
When method DELETE
Then status 200
Then match response.status == 'success'
删除\u project.feature
* def id = '55000000005021'
* def result = call read('delete_project.feature')
Given path 'project', '#(id)'
When method DELETE
Then status 200
Then match response.status == 'success'
低于异常
com.intuit.karate.exception.karateeexception:projects.feature:48-
删除_项目。功能:11-状态代码为:404,预期为:200,
响应时间:239,url:
答复:
{“状态”:“失败”,“数据”:{“错误代码”:“无效的URL模式”,“消息”:“请”
检查尝试访问的URL是否为正确的“}}”✽.* def
结果=调用读取('delete_project.feature')(projects.feature:48)
还有一个疑问,如何通过传递ID列表来迭代这个过程。我在foo变量中有多个id,我想为该foo变量中的每个可用id调用delete\u project.feature
* def foo = get response.data[*].id
我认为你把路径参数复杂化了,改为:
Given path 'project', id
阅读文档的这一部分:如果您还有第二个问题,请打开一个新问题。请在这里将答案标记为“已接受”,然后创建一个单独的问题,请帮助我。