我有一个具有不同数据集(超过5行的数组)的json文件。我想将其用作构建新端点的路径和查询参数,并验证新建端点的响应以查找特定值。我想将其作为循环运行。
答案 0 :(得分:1)
我希望您实际上花一些时间阅读文档,然后提出一些具体问题。请参考:
https://github.com/intuit/karate#dynamic-scenario-outline
Feature: scenario outline using a dynamic table
Background:
* def kittens = read('../callarray/kittens.json')
Scenario Outline: cat name: <name>
Given url demoBaseUrl
And path 'cats'
And request { name: '<name>' }
When method post
Then status 200
And match response == { id: '#number', name: '<name>' }
# the single cell can be any valid karate expression
# and even reference a variable defined in the Background
Examples:
| kittens |
答案 1 :(得分:0)
谢谢彼得。我正在尝试测试事件是否已发布到kafka主题中。 2步验证 步骤1:找出主题中的开始和结束偏移量和分区(JSON响应) 步骤2:使用步骤1的JSON响应中的数据来挖掘每个分区,以找到正确的事件。
检查空手道是否可以支持此操作。