Ask a Question

Groovy Script assertion count

Readyapiuser
Occasional Contributor

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": []
}
}

2 REPLIES 2
nmrao
Community Hero

Re: Groovy Script assertion count

Readyapiuser
Occasional Contributor

Re: Groovy Script assertion count

Thanks a bunch. 

cancel
Showing results for 
Search instead for 
Did you mean: