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 DurrantMay 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.– GayathriMay 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 OeiMay 19, 2018 at 14:30
-
Related: stackoverflow.com/questions/13178810/…– tkruseNov 6, 2018 at 9:07
1 Answer
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