Forum Discussion
nmrao
Champion Level 3
Not sure I got it quite right. It is general practise that, there should be a separate assertion for each value. This is really helpful to know in case of failures.
JamesChorus
8 years agoNew Contributor
Thanks Rao.
It was simply a case where I wished to check a list of field were being returned within my json response, and creating individual assertions for each field is a lengthy step.
I'm sure there is a quicker way to check a list of results, but as a new user to the tool, I'm yet to discover how to.
- nmrao8 years agoChampion Level 3Can you show the input response, and expected data that you want to compare?
Can't image what exactly you are talking about.- JamesChorus8 years agoNew Contributor
I've attached an image showing the json response, and then the List of individual assertions I added to ensure I'm being returned all expected fields.
As you can see, I've added the field assertions individually (32), which would have been quicker to have added all expected fields in one assertion.
- nmrao8 years agoChampion Level 3I would go for Script assertion in such case.
See if below example would fit the bill.
http://stackoverflow.com/questions/36631111/how-assert-parameter-name-without-value-using-groovy/36640507#36640507
Related Content
- 6 years agoyognsal