Hello Team,
I have a JSON response with multiple values [say, IDs] in it, I want to extract all of them from the JSON response and save it in the .csv/feeder so that i can use them in th enest scenarios.
Json Response:
[
{
"id": 5156,
"orderId": 1,
"step": "Step Desc",
"result": "Result Desc"
},
{
"id": 5157,
"orderId": 2,
"step": "Step Desc",
"result": "Result Desc"
},
{
"id": 5158,
"orderId": 3,
"step": "Step Desc",
"result": "Result Desc"
}
]
I want to save the highlighted values in the csv file and my feeder should look like
id
5156,5157,5158
Till now i have used below methods
.check(jsonPath("$..id").findAll.saveAs("ID")
.exec( session =>
{scala.tools.nsc.io.File("<FilePath>\\ID.csv").appendAll("ID"+",")
session}
)
However only first value is getting saved in the file and rest all getting ignored.
Kindly help to sort this issue.
Thanks in advance..!!