Forum Discussion

ztd's avatar
ztd
New Contributor
9 years ago

Is it possible to use an expression - like ">10" - for Expected Result in JsonPath Count assertion?

Like in the subject. I have a simple JSON response like this :

 

{
"Id": 100302,
"Name": "A2 TEST "
},
{
"Id": 100315,
"Name": "Boligselskab el-vand"
},

 

I need an assertion that will pass if there are 10 or more elements. I tried tinkering with JsonPath Count.

My expression - $..* - is returning 108 elements and assertion passes if I put 108 into the Expected Result box, but the number of elements might vary, but as long as there are 10 or more the test should pass. How do I do that?

No RepliesBe the first to reply