I hope if Katalon can expose some api’s like i suggested, code will be more consistent. Or else i will end up with some custom methods and some katalon specific methods. The reason for choosing Katalon is the rich set of API’s they provide. I am sure this will be the requirement for most of the teams which verify the json body.
Well, that’s a shame because using Groovy’s GPath methodology for both JSON and XML would give you exactly that capability – and it’s pretty easy. But if you don’t want to use it, well… I guess you’ll need to wait until someone adds the APIs you want.
Thank you Russ Thomas for the reply and I apologize if i was bit rude.
I agree with you regarding GPath or JsonPath. Currently i am using something like that. Most of the cases there will be some other alternative to do something.
What i meant was, if Katalon exposes api for checking whether a node is present or not, code will be consistent[Can always use Katalon API’s] and more over anyone can use it. Even if there coding skills are limited. I believe that is the ultimate aim of Katalon.
Already Katalon support methods like WS.verifyElementPropertyValue(response, ‘body.user.firstName’, “James”) for checking a node value. So i feel like, if you tweak it a little bit, that specific functionality can be achieved.
Katalon is a great tool with lots of features and is provided for free. Thanks for that.
Parse the json with JsonSlurper. Based on the json response (array or object) the parsed object will be a List or a Map. So, use groovy native methods to check if a given value or key is present.
Ref. docs: