1

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 ..

4
  • 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 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
    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
    May 19, 2018 at 14:30
  • Related: stackoverflow.com/questions/13178810/…
    – tkruse
    Nov 6, 2018 at 9:07

1 Answer 1

2

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 that you have read and understand our privacy policy and code of conduct.

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