How to parse JSON responses in Katalon Studio

This is a companion discussion topic for the original entry at

I tried following code:

String idValue =
String idValue2 = parsedJson.get("menu").get("id")

But it is not working for me. I can reach till .get(“menu”). However it does not have another get method to call. Instead it has getClass(). I had to use following code:

String menu = parsedJson.get(“menu”).toString()

and search the string for exact substring. But this is not the right way to get values.

Please let me know if I am missing anything.

Hi @ankush.ajari

Auto suggestion sometimes doesn’t provide you with the appropriate functions. If you write as above then does the test fail ?

yes. It fails.

May I see the failing script you’re using, so that I can try it ?

@ThanhTo, hey I got it working.

I am having a bit different json which was having ‘_’ as a prefix. Hence the path was not write.

I had to use:

Thanks for your help anyways.

If you run into the problem below make sure the Ctr+Shift+O to import properly… you might not have imported the class correctly which was my problem.

When I try to utilize the JsonSlurper class Its not showing any functions. I made sure to import the suggested package and its still not working. When I check the docs there is no info on JsonSluper class? The only thing I can find on parsing is turning the json response into an object.


@bradley.latreille relax . jsonslurper came from groovy.

Thank you, however my above comments were only questions and were never meant to come off as aggressive what-so-ever. Thank you for letting me know where I can find the specs for this class :slight_smile:

@bradley.latreille i think i missed the question mark :slight_smile:

the idea in my response is … since JsonSlurper is not in a katalon package, but part of the groovy himself, you won’t find it in katalon api docs, but into groovy docs (i am lazy to search for it … in fact i hate searching from my dumbphone)

on the other side … yeah, i know, someone may expect the intellicence to show proper suggestions when hitting ctrl-space or as long as you type the code … but i think here the guilty one is the eclipse engine or part of it … sometime does not show all available methods or properties available for a given object.

it is a known issue which i hope will be improved one day

1 Like

Ah yes, I run into this far too often as well and hope for a future fix :slight_smile: I do take part responsibility for not searching first though :stuck_out_tongue: Do you think the code would still run but I would just have funky greyed out functions? and is there a different HotKey than Ctr+Shift+O because im also finding it removes what it assumes is useless but then breaks my code sometimes :stuck_out_tongue:

but since you are kind, i made an effort.
here it is:

as for the ctrl-shift-o … mhm. yeah, is removing unused imports also (that is fine for me)… i didn’t noticed to remove also needed ones … but i think it is possible.

nothing is perfect

1 Like

Thank you kindly! :slight_smile:

1 Like

Hi ,
Please follow below tutorial on json parsing using jsonSlurper

i trying to create a code with katalon to insert into data into json file
please who can help me

Try import gson and parse it to a file