def str = '''{
"ontologyName": "Procedure",
"linkedResources": [{
"tableName": "ProcedureTable1",
"columns": [
"columnAA",
"columnBB",
"columnCC"
]
},
{
"tableName": "ProcedureTable2",
"columns": [
"columnAA",
"columnBB"
]
},
{
"tableName": "ProcedureTable3",
"columns": [
"columnAA"
]
}
]
}'''
def json = new groovy.json.JsonSlurper().parseText(str)
def data = json.linkedResources.inject([]) { list, table -> list << table.columns.collect { ['table': table.tableName, 'column': it]}; list.flatten() }
data.each {
log.info "${it.table}, ${it.column}"
}
Is this what you needed?
You can test this online
https://ideone.com/NkcNMd
If you want to implement it in your case, you need make few modifications to the above script.
In the Data source step, use Groovy type. And have above script in place
1. instead of fixed data, you can use json file and read that and assign it to str variable
2. need to define a variable and assign current row count
3. loop thru variable data and assign it variable result
In the test request step, where the data is required use table, column respectively.
Refer documetation link.
https://support.smartbear.com/readyapi/docs/testing/data-driven/types/groovy.html