I am using karate and i have a problem statement like i want to continue execution even if a error/exception comes.
I am using Karate forEach for the same, below is the sample code which i am using:
- def fun = """ function() { try { karate.forEach(fields, function(item) { karate.call('validations/Test.feature', {ffield : item}); }); } catch(error) { console.error('An Error Occured:',error); } } """
Here, I am executing a API, and providing fields to an API, Now when i provide fields with a test data file, and a field is not acceptable in the API, it get failed and execution gets stop and moving further for execution for other fields. Any way to handle this in karate?
I tried above Karate forEach with try catch but its not working