1

so, I want to use conditional logic in my code, which the condition is when I got response.response_code == '00' so it will run

And match response == res_3[0]
And match each response.data.bills == res_3[1]

And if response.response_code != '00' , it will run

And match response == res_3
And match each response.data.bills == res_3

so, what is the best conditional logic for this case ??

1 Answers1

0

Read the docs please: https://github.com/intuit/karate#conditional-logic

Use a second feature file:

* eval if (response.response_code != '00') karate.call('it-will-run.feature')

Note: you can't use match where JavaScript is expected, refer: https://stackoverflow.com/a/53961806/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248