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

  • 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 – Michael Durrant May 19 '18 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 '18 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 '18 at 14:30
  • Related: stackoverflow.com/questions/13178810/… – tkruse Nov 6 '18 at 9:07
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, privacy policy and cookie policy

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