During my Karate scenario automation got the below problem statement. Could anyone please help me on this?
My JSON file will contain,
{
"schema_id": 25,
"records": [
{
"value": {
"NUM_CHARGE_ID": "#(numChargeID)",
"DTE_START": "2017-05-26",
"NUM_DAY": "#(numDay)"
}
}
]
}
From my Karate feature file I want to pass data from Example and depends on the data set it should create multiple array element in the json. Like,
Examples:
| numChargeID | numDay|
|C10,C21,C15,C18|1,2,3,4|
{
"schema_id": 25,
"records": [
{
"value": {
"NUM_CHARGE_ID": "C10",
"DTE_START": "2017-05-26",
"NUM_DAY": "1"
},
{
"NUM_CHARGE_ID": "C21",
"DTE_START": "2017-05-26",
"NUM_DAY": "2"
},
{
"NUM_CHARGE_ID": "C15",
"DTE_START": "2017-05-26",
"NUM_DAY": "3"
},
{
"NUM_CHARGE_ID": "C18",
"DTE_START": "2017-05-26",
"NUM_DAY": "4"
}
}
]
}
Is there any way in Karate that i can handle this type of situation?