I'm using karate tool for api automation testing. Is there a way to do comparison or A/B testing using karate - That's testing with 2 urls and making sure both return the same response..please help ..

  • That is not A/B testing. It might be testing of A/B testing I guess. A/B testing would have different content responses. Need a ton more info to really help you here Commented May 19, 2018 at 12:57
  • The same service when hosted in 2 different servers say for example web logic and tomcat , i have to make sure both the hits return the same response when I migrate the service from one server to another . Please let me know if any other information is required.
    – Gayathri
    Commented May 19, 2018 at 13:04
  • It helps if you would add more context to your question, not only here in the comments. And I think, as terminology goes, your are trying to setup a regression test. With A/B testing something else is meant.
    – Ray Oei
    Commented May 19, 2018 at 14:30
  • Related: stackoverflow.com/questions/13178810/…
    – tkruse
    Commented Nov 6, 2018 at 9:07

1 Answer 1


Yes, this should be very easy with Karate. I suggest you don't over-engineer tests and make 2 requests in your test. Save the response of the first request.

Now all you need to do is perform a match of the first response - that it is equal to the second response.

And because Karate allows you to set some fields of the "expected" JSON as #string or #notnull etc, you can easily handle cases where ID-s and time-stamps will be different.

Also suggest you use StackOverflow for Karate questions: https://stackoverflow.com/questions/tagged/karate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.