I have to call another feature file when a particular response header exists. It is failing as when it goes to if condition and doesn't find that response header it gives error and doesn't execute that feature file. How to achieve this in Karate?
The value of this header is dynamic.
* if (responseHeaders['APP-ID'][0] !=null) karate.call('classpath:resources/userData.feature@test1', { Id: Id , value : 'success' })
Error:
<<<<
org.graalvm.polyglot.PolyglotException: TypeError: Cannot read property "0" from undefined
- <js>.:program(Unnamed:1)