How to say set accept any value greater than Zero
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2018
01:25 AM
10-28-2018
01:25 AM
How to say set accept any value greater than Zero
As on the image i can do an assertion for the node $.result and now its value is 4.
But is there any way where i can set this assertion to accept any value greater than Zero.
Eg: if the node $.result is having 6 then my currant assertion will get fail because its looking for 4.
Hope you can understand. Thanks.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2018
02:28 AM
10-28-2018
02:28 AM
Hi,
I don't know if that's possible with JsonPath Match assertion (I haven't used it much), but here's how you can do it with a Script assertion:
def result = new groovy.json.JsonSlurper().parseText(context.response).'result'
assert result > 0
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2018
06:54 AM
10-28-2018
06:54 AM
oops, This is not possible with the given UI,
To perform you suggestion i have to use script assertion.`
@JHunt wrote:
Hi,
I don't know if that's possible with JsonPath Match assertion (I haven't used it much), but here's how you can do it with a Script assertion:
def result = new groovy.json.JsonSlurper().parseText(context.response).'result'
assert result > 0
