1

The API I'm testing sometimes respond with different error codes and questions, how can I used 'Examples' and match assertion to check one OR other?

Below it follows the example that I wanted to have working but I don't know how to do using Karate Framework:

And match response == <expected_response> || <expected_response_alternative>

Examples:
      | cid       | email                                 | password     | comment_text                                        | expected_response                                                                                      |
      | 289634903 | 'something@bla.com' | 'Sandcastl3' | 'like for like for like for like for like for like' | {"status": "failure","error": "ERROR-CONTENT-004","message": "Failure to add a comment to an element"} |
rgr2k
  • 11
  • 1
  • please linked answer carefully as to why this is not recommended. kindly assume that especially handling different response codes is not supported (it can be done indirectly via the `responseStatus` https://stackoverflow.com/a/50952625/143475 ) I personally feel you should get more experience with simple tests before trying to do these "clever" tests – Peter Thomas Apr 20 '22 at 14:39

0 Answers0