I am able to iterate over data in json array in karate framework via scenario outline but unfortunately it stopped recognizing any java interop function calls inside scenario outline.
For Ex:
Scenario Outline: Publish NewAccount kafka messages reading accountIds from dynamic csv file new-account api and Validate data in database Given path '/new-account'
And messageHeader.message_type = 'NEW_ACCOUNT'
And messageHeader.publisher_id = 'Customer'
And newAccount.messageHeader = messageHeader
And newAccount.accountNumber = <account_id>
And header Content-Type = 'text/plain'
And request <account_id>
When method post
Then retry until status 200
* call initializer.sleep 1
* print 'row: ', __row
#Validate DB entries in journal table for new account
* def journal_query = "SELECT * FROM journal where account_number ="+newAccount.accountNumber*1
* print "query==",journal_query
* def accounts = call initializer.dbUtils.readRows(journal_query)
* match accounts == '#[1]'
* match accounts[0].account_number == <account_id>*1
* match accounts[0].account_sub_type == 'CASH'
* match accounts[0].entry_type_code == 'B'
* match accounts[0].firm == 'NFSC'
new_account.feature:232 - evaluation (js) failed: initializer.dbUtils.readRows(journal_query), javax.script.ScriptException: TypeError: initializer.dbUtils.readRows is not a function in at line number 1 stack trace: jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
Does anybody has any idea why? and how to fix this issue.