I need help with this block of code. If I manually specify arr_loggd_errors2
object as a JSON array, this code works, but for some reason it does not when I use a karate step to pull a result set from my system under test.
I thought that using karate.toJson would solve my issue, but it still finds zero items. How can I debug this? Do you see an obvious error here? Sorry, I can’t really provide additional detail.
# Looping through each static document item
* def found_s = false
* def find_any_s = function(item) { print(item); if (item.friendlyName == 'Handling Static event' && item.encodedFile.test_info == 'Karate Test Static') { karate.set('found_s', true); }; }
And assert karate.sizeOf(arr_logged_errors2.result) > 0
And karate.forEach(arr_logged_errors2.result, find_any_s)
* assert found_s == true