Forum Discussion

Readyapiuser's avatar
Readyapiuser
Occasional Contributor
8 years ago

Groovy Script assertion count

Hi, 

 

Can someone please guide me how to use count in groovy script assertion?

 

My response is as below:

 

I want to count occurrence of text "name", "lastName" etc from below response. I want to include it in script assertion and can not use json count match. 

 

{
"created": {
"event": [{
"name": "Joe",
"lastName": "Matt"
}]
},
"notcreaed": {
"event": []
}
}