Introduction
This blog will go through the script and response SLA in ReadyAPI. Keep reading if you are keen to know about this technology and strengthen your concepts.

Script Assertion
Availability
The Script assertion uses a groovy script to perform checks on the message. We use it to verify the message content, headers, properties, and other components.
How to Create an Assertion?
Depending on the application, we can validate the following information.
Functional Tests | The request or response |
Security Tests | The request only |
APIs(Virtual) | The response only |
Functional Tests
The steps are-
- Open the test step as shown in the image.

- Click on add assertion, and the following dialog appears. Select ‘Script Assertion’ Assertion or select it manually.

Assertion script mainly has the following objects-
Object | Description |
log | Log is an Apache Logger used to post messages. |
Context | This is a TestCaseRunContext object that gives an interface to test steps and test runner. |
messageExchange | messageExchange is an object that provides access to a scripting interface for requests and response data. |
You may enter your script in the edit box and run it.
Virtual Tests


Assertion script mainly has the following objects-
Object | Description |
log | Log is an Apache Logger used to post messages. |
Context | This is a TestCaseRunContext object that gives an interface to test steps and test runner. |
messageExchange | messageExchange is an object that provides access to a scripting interface for requests and response data. |
You may enter your script in the edit box and run it.
APIs(Virtual)


Assertion script mainly has the following objects-
Object | Description |
log | Log is an Apache Logger used to post messages. |
Context | This is a TestCaseRunContext object that gives an interface to test steps and test runner. |
messageExchange | messageExchange is an object that provides access to a scripting interface for requests and response data. |
You may enter your script in the edit box and run it.