1

I would like to find a string by iterating all elements in the response and not only any particular position as example below , I would like to remove that indexing on the retry and like to improve the logic to retry in whole response and find the string

**When path getFormattedActivitiesForDeal + BR
And header Authorization = 'Bearer '+ PC_User_accessToken
And header Content-Type = 'application/json'
And retry until response[0].dealActivities[4].action == "Checked: Driver’s Licence"
When method get
Then status 200
And json  getResponse = response
And assert response[0].dealActivities[4].result == "Validated"**
  • I already tried to point you to this answer, you can write a re-usable function within which you can do anything you want and any number of checks. I have nothing more to add. https://stackoverflow.com/a/55823180/143475 – Peter Thomas Jan 26 '22 at 13:05
  • Thanks @PeterThomas I tried with the re-usable function and it does the thing in the front end but getting error retry condition not satisfied: isValid(response) I tried below code - * def isValid = function(x){ return karate.match(x, { dealActivities: '##[Checked: Driver’s Licence]' }).pass } And retry until isValid(response) – SeleniumUser Jan 26 '22 at 16:09
  • It is impossible to diagnose this without seeing ALL the code, so follow this process if you can: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue - lets hope someone else here can help you, I can't. – Peter Thomas Jan 26 '22 at 19:42

0 Answers0