Katalon Studio now supports the ability to write verification scripts directly in Web Service object's details. This support will greatly reduce the time of going back and forth between the test case and request object to add test scripts. Verify the response can be done instaneously.
Verification snippets can be accessed by clicking on the 'Verification' tab within Web Service object's view.
When you click on one of the available snippets, Katalon Studio will generate a snippet for you.
The generated snippet is ONLY an example. DON'T try to use them immediately without adjustments matched your needs, otherwise it will not work.
Once the verification snippets are generated, you can use it in either in your current Web Service's object or in your Test Case
In test case: Use 'Send Request and Verify' keyword. This will also send the current request and execute verification snippets.
Execution results will be displayed in 'Log Viewer' tab.
On the right panel of 'Verification' tab is the list of common pre-built snippets which can assist you in most of the verification cases.
|Get current response||Return response object after sending a request successfully.||5.5|
|Get a global variable||Return a Global Variable's value.|
|Get a variable||Return the value of a variable that you've created in the Web Service Test Object.||5.7|
|Response body: Contains string||Verify if response's body contains a specific string.||5.5|
|Response body: Convert to JSON Object||Convert response's body to JSON.|
|Response headers: Content-Type header||Verify Content-Type header's value.|
|Status code: Code is 200||Verify if response's status code is 200 or no.|
|Status code: Successfully request||Verify if the request is sent successfully|
|Response body: number of elements||Verify number of elements from response|
|Response body: element not empty||Verify specified element is not empty|
|Response: Array contains||Verify specified arrays contain values|
|Response: Get single info of array list||Get single info of array list|