mpartyka
5 years agoContributor
JSON as dataSource
I am trying to read a JSON file in as a DataSource test step (see JSON below). The number of nodes of the properties (named "columns") varies with each tableName in the JSON file. Is it possible to read in row by row and end up with the simple result posted below? It seems like this should be simple, but I've been struggling for hours! Thanks!
INPUT JSON FILE
{ "ontologyName": "Procedure", "linkedResources": [{ "tableName": "ProcedureTable1", "columns": [ "columnAA", "columnBB", "columnCC" ] }, { "tableName": "ProcedureTable2", "columns": [ "columnAA", "columnBB" ] }, { "tableName": "ProcedureTable3", "columns": [ "columnAA" ] } ] }
DESIRED OUTPUT
ProcedureTable1,columnAA ProcedureTable1,columnBB ProcedureTable1,columnCC ProcedureTable2,columnAA ProcedureTable2,columnBB ProcedureTable3,columnAA
- Can you please tell what have you tried? So, every one will understand what does not work.
So, you need two values per row and it will be of 6 rows which you want to loop thru. Correct?
Hope below link can help you.
https://support.smartbear.com/readyapi/docs/testing/data-driven/types/groovy.html