Forum Discussion
ankitaT
15 years agoContributor
Hi,
To extract the particular value, you'll need to use regex.
The value can be validated using script assertion.
Write a simple code in groovy in that script assertion.
Here is a sample:
def response = <using get data, take the response string here>
def eventId = response.split("EventId>")[1].replaceAll("<","").replaceAll("////","")
//it will return the value of eventId
// now assert with the desired value
assert eventId == <desired value>
Hope it helps.
Regards,
-
To extract the particular value, you'll need to use regex.
The value can be validated using script assertion.
Write a simple code in groovy in that script assertion.
Here is a sample:
def response = <using get data, take the response string here>
def eventId = response.split("EventId>")[1].replaceAll("<","").replaceAll("////","")
//it will return the value of eventId
// now assert with the desired value
assert eventId == <desired value>
Hope it helps.

Regards,
-