-1

I have scenario wherein I am able to call a service with 200 response code from Karate, but it's not returning response data because of some error in the stored procedure (database server down). In this case, I want to first call & check the relevant stored procedure from Karate & if it's returning data successfully, I should then call the API. How can one call/check the stored procedure from Karate?

I tried looking for material to achieve this, but no luck.

I should be able to check the data/availability of the stored procedure before calling the service from Karate. Also, if there is any error with the stored procedure, same should be included in the logs for troubleshooting.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Shrikant
  • 91
  • 1
  • 7

1 Answers1

1

You seem to be asking the same question again: https://stackoverflow.com/a/56839037/143475

The short answer is - use Java interop and you can do anything in Karate: https://github.com/intuit/karate#calling-java

If you are doing normal API testing, you don't need to use Java and many teams are happy this way - just making HTTP requests. To do what you are asking, just see the above link, and there is plenty of material on this. If you can't figure this out from the documentation and if you have challenges writing Java code - then maye Karate is not for you - and you need to look for some other alternative.

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