# How to verify if an element is present in response body

**URL:** <https://forum.katalon.com/t/how-to-verify-if-an-element-is-present-in-response-body/47076>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [September 3, 2020, 8:56pm UTC](https://forum.katalon.com/t/how-to-verify-if-an-element-is-present-in-response-body/47076 "2020-09-03T20:56:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yramaswamy](https://avatars.discourse-cdn.com/v4/letter/y/6a8cbe/32.png) [@yramaswamy](https://forum.katalon.com/u/yramaswamy)\
**Post date:** [September 3, 2020, 8:56pm UTC](https://forum.katalon.com/t/how-to-verify-if-an-element-is-present-in-response-body/47076/1 "2020-09-03T20:56:41Z")

</div>

I am trying to send a request and capture the response in a variable like this.

def CreateOrderResponse = WS.sendRequestAndVerify(findTestObject(‘Object Repository/CreateOrders’))

My Response Body is like this

{  
“orderToken”: “b5427cab172146a7bafa3ecae1c5c336545be3eae20e4856838bf8fa492f65eb”,  
“created”: “2020-09-04T03:00:39.5019832+10:00”,  
“expires”: “2020-09-06T03:00:39.5028261+10:00”,  
“paymentProcessingUrl”: “[[http://devsrqa:8045/PaymentGateway/ProcessingPage/b5427cab172146a7bafa3ecae1c5c336545be3eae20e4856838bf8fa492f65eb](http://devsrqa:8045/PaymentGateway/ProcessingPage/b5427cab172146a7bafa3ecae1c5c336545be3eae20e4856838bf8fa492f65eb)]”  
}

Is there a verification snippet to find if the elements OrderToken, created, expires and payentprocessingURL are present???

Any help is much appreciated

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [September 3, 2020, 9:01pm UTC](https://forum.katalon.com/t/how-to-verify-if-an-element-is-present-in-response-body/47076/2 "2020-09-03T21:01:15Z")

</div>

You can verify the entire response as a JSON document using a JSON Schema…

> [@Justify, a JSON Schema Validator, in Katalon Studio](http://forum.katalon.com/t/justify-a-json-schema-validator-in-katalon-studio/25560):
>
> I have made a demo project on GitHub [GitHub - kazurayam/JustifyInKatalonStudio: A Katalon Studio project that demonstrate how to use Leadpony: a JSON Schema validator at https://github.com/leadpony/justify](https://github.com/kazurayam/JustifyInKatalonStudio)Motivation [JSON Schema](https://json-schema.org/) is a vocabulary that allows you to annotate and validate JSON documents. JSON Schema is a nice tool for Web Service testing in Katalon Studio. As the post in Katalon Forum “[JSON Schema validation broken after 5.9.0](http://forum.katalon.com/t/json-schema-validation-broken-after-5-9-0/23457)” reports, [everit-org/json-schema](https://github.com/everit-org/json-schema), a JSON Schema vali…
