how the values should be seperated. request 1 will depend on request to if the response has all 8 values. Do I need to add assertion for each single value ?
Hi Rao,
I am also trying to do what the original user was asking. This is where you have your request set up, You are on the Assertions tab, and you wish to add in multiple/a list of assertions in One "Contains Assertion" check.
So, how do you separate each value you wish to check for? OR are you only able to add one Contains Assertion value per Assertion?
Thanks, James
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.
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.
Having individual assertions is the standard approach. But if you still wish to do that, you can't do that on Contains assertion. But you can use XPath assertion and have Contains function
Your declaration would be:
contains(//*:ResponseFiled, "ValueToValidate1") and contains(//*:ResponseField, "ValueToValidate2")
Expected would be: true
Hope that helps
Subject | Author | Latest Post |
---|---|---|