In one of my test scenarios I make the request and I want to collect data from the response to an array and here for this purpose I've defined the js function within karate-config.js
which accepts one argument.
When I call it, I'm always get the same error, but when i use another function with static value it works nice, but when i try to pass the dynamic object (response from the pre-request) it fails. Here is the error:
Logger feature call failed: classpath:integration/base_oai_pmh_tests/mod-configuration-integration-cases.feature
arg: null
mod-configuration-integration-cases.feature:14 - Failed generating bytecode for :33
The object that i pass to the function is okay and its definitely not null.
here is the function into config file
here is the scenrio with js function usage
I've tried these possible solutions as well and they are failed too:
Karate doesn't support the arrow functions and instead of js map function we should use karate.map and if you want to collect the data from json array then using of JSON path would be better : def configIds = configResponse.configs[*].id