如何使用方案大纲来迭代不仅仅是单个单元格的JSON
https://github.com/intuit/karate#the-cucumber-way
Data.json
[{
"address": {
"addressLine1": "ttes",
"addressLine2": "Test",
"addressLine3": "Test",
"addressType": "business",
"city": "TEST",
"company": "TEST",
"country": "TEST",
"state": "TEST",
"postalCode": "XXXX"
},
"name": {
"firstName": "TEST",
"lastName": "TEST",
"middleInit": "T",
"title": "Mr."
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999",
"phoneType": "mobile"
},
"email": {
"emailAddress": "TEST@TEST.com"
}
},
{
"address": {
"addressLine1": "ttes1",
"addressLine2": "Test1",
"addressLine3": "Test1",
"addressType": "business",
"city": "TEST1",
"company": "TEST1",
"country": "TEST1",
"state": "TEST1",
"postalCode": "XXXX"
},
"name": {
"firstName": "TEST1",
"lastName": "TEST1",
"middleInit": "T",
"title": "Mr."
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999",
"phoneType": "mobile"
},
"email": {
"emailAddress": "TEST@TEST1.com"
}
}]
====
Feature: Read from File
Background:
* def Testdata = read('Data.json')
Scenario Outline: [1] Test with multiple records on JSON
Given url_stg
And path 'test','test'
And request Testdata
When method POST
Examples:
|Testdata |
答案 0 :(得分:1)
由于您的情况非常直接,请参阅本文档。
请参阅此答案以了解向Scenario Outline:
提供数据的不同方式