1. Contains:
Search for the existence of a String in the Response Value. Applicable for JSON/XML reponses.
For Example if your response JSON is
"Success": true, "AUTH": { "UserId": "linkeshkannavelu", "TimeStampUtc": "2014-04-22T07:25:05.0077957Z", "SignedAs": "4Rfc0/test/Vcpk=" }
and you are looking for the string linkeshkannavelu in the response, then you can enter the string in the Assertion Window.
2. XPath Match:
Traverse the XML response and return the value presents in the specific XML Node and then compares it with the expected value given.
Applicable only to property in XML Format.
For Example, in the last post we have verified the title of the site http://linkeshkananvelu.com.
If the returned response is
<html> <head> <body> <title>Keep Software Testing Weird</title> </body> </head> </html>
You can check the title of the page by using the following Xpath.
3. Not Contains
Search for the non existence of a String in the Response Value. Applicable for JSON/XML reponses.
For Example if your response JSON is
"Success": true, "AUTH": { "UserId": "linkeshkannavelu", "TimeStampUtc": "2014-04-22T07:25:05.0077957Z", "SignedAs": "4Rfc0/test/Vcpk=" }
and you are looking for the string TestUsername to be not present in the response, then you can enter the string in the Assertion Window.
If the String exists in the response, then the test will fail.
4. Valid HTTP Status Codes:
In the reponse, usually we will get a HTTP Status Code. We can assert these response codes also.
For example, if you are checking that your response message got the code HTTP Status 200, then you can assert the code by
5. Invalid HTTP Status Codes:
This is similar to Not Contains. If the HTTP Status Code that we are receiving Should not contain the list of Codes, then we can check those assertions using this.
For example, if you are checking that your response message should not have the code HTTP Status 401 and 404, then you can assert the response code by
These are the frequently used assertions in SoapUI.
It should have that Option in SoapUI. .I am using the latest version. Click on file and you should get the “New Rest Project” option.Or else you can also proceed with “New Generic Project” to create http requests.
LikeLike
if Soap UI not having “new rest project ” option then how to create a project instead
of this steps.
LikeLike