API/Web Service Testing Response Text/Value


#1

Is there a way for Katalon Studio to look for a defined TEXTVALUE in an API Web service call?
I try using the: “WS.verifyElementPropertyValue”
It works if I use it like this : WS.verifyElementPropertyValue(response, ‘[9].config.viewDescriptors[4].buttons[0].navigationValue’, “TEXTVALUE”)

However, I can’t reuse this script because of the JSON Path is Dynamic, ("[9].config.viewDescriptors[4].buttons[0].navigationValue") I kind don’t want to parametrize them.

any ideas?


#2

Hi there, try the below …

// Response body: Containing String
assertThat(response.getResponseText()).contains(‘TEXTVALUE’)

The dynamic json path can be handled using external jar i.e. Jayway JsonPath


#3

Please explain :slight_smile:


#4

Kindly check the below post by @kazurayam for more details