cancel
Showing results for 
Search instead for 
Did you mean: 

Assert Script

SOLVED
Occasional Contributor

Assert Script

I need to verify via script assertion that within "SimpleList" that

SimpleName1 with "outcome": "Met"

SimpleName2 with "outcome": "Met

.

.

.

etc......

 

I'm able to output SimpleName1, SimpleName2 etc but for verification I need both

SimpleName1 with the "outcome": "Met" in order for my assertion to pass. Also I'd like to be able to filter my assertion, so for example only validate within SimpleList that "SimpleName1" "outcome": "Met" and  "SimpleName4" "outcome": "Met" and just ignore the rest.

 

 

sample response:

"SimpleList": [
{
"SimpleName": "SimpleName1",
"outcome": "Met"
},
{
"SimpleName": "SimpleName2",
"outcome": "Met"
},
{
"SimpleName": "SimpleName3",
"outcome": "Met"
},
{
"SimpleName": "SimpleName4",
"outcome": "Met"

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Contributor

Re: Assert Script

Hi @rg2018,

 

If it is understood to you that everytime your "outcome" value remains same then you can store this in properties and validating it using json slurprer in script assertion.

 

Click "Accept as Solution" button if my answer has helped, and remember to give "kudos" Smiley Happy

 

Thanks,

Himanshu Tayal


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" Smiley Happy

Thanks and Regards,
Himanshu Tayal
1 REPLY 1
Regular Contributor

Re: Assert Script

Hi @rg2018,

 

If it is understood to you that everytime your "outcome" value remains same then you can store this in properties and validating it using json slurprer in script assertion.

 

Click "Accept as Solution" button if my answer has helped, and remember to give "kudos" Smiley Happy

 

Thanks,

Himanshu Tayal


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" Smiley Happy

Thanks and Regards,
Himanshu Tayal