How to extract response body parameters

Hey Guys,

I was wondering if anyone could help me with this.

Katalon script file

Object response = WS.sendRequest(findTestObject('PublicApi/PublicApiEndPoint'))

In the above script file, getResponseText() method spits out below reponse,
how do I extract the value for parameter, lets say “authenticationToken”, “displayName” etc…

"displayName":"Service Desk User",

I don’t see a available method in below link

Could someone please advise? or
Am I missing something from the above?


1 Like


The extracted data from the response in your case is in JSON format, so we could get the value of each key “authenticationToken”, “displayName” and “smartNumber”. Here is an example of geting the value out:

import groovy.json.JsonSlurper class Example {   static void main(String[] args) {      def jsonSlurper = new JsonSlurper()      def object = jsonSlurper.parseText('{ "name": "John", "ID" : "1"}') 		      println(;      println(object.ID);   } }

Hey Trong,

Many thanks above groovy code works like a charm,
however I’ve chose to use Katalon because it supports java, I’ve never worked on Groovy before.
Therefore could you may be point me to a way to achieve this through java way please :slight_smile:



I found some help from stackoverflow ( After convert the response to json object, we can get any properties in the json.