The REST Request test step sends a REST request of the specified type (GET, POST, PUT and so on), gets a response and validates it with assertions. You can adjust the test step parameters, authorization settings, and so on.
Important
To use the REST Request test step, you need to add a REST service to your project.
Tip
Try the new API Connection test step. It is a protocol-agnostic test step that allows you to send REST requests.
Each REST request test step is based on a REST request defined in your API. ReadyAPI takes the method, resource and parameters specified for this request. To change these data, you need to link your test step to another REST request. To change the endpoint and parameter values, you can use the test step editor, which is similar to the editor you use to modify requests (see REST Requests). The changes you make to your test step do not affect the base request.
![]() |
Here is a brief description of available panels in the request editor:
Displays request parameter information in a table. You can see the parameter’s name, value and type. ImportantYou can use the project, test suite or other properties to specify parameter values. For information on request parameter types (QUERY, TEMPLATE, HEADER, and others) and how to specify them in the editor, see REST Parameter Types. | |
Displays the header and body of the request in a text format. ImportantReadyAPI populates this tab after you run the test step. | |
Displays the request body as a tree. Works for POST and PUT requests only. You can change elements’ and attributes’ values in-place. Just double-click the cell with the needed value. | |
Lets you specify parameter values by using various edit controls. | |
Use this panel to specify the authorization type (Basic, NTLM, or SPNEGO/Kerberos) and authorization parameters for your request. | |
Allows you to specify the files to be attached to the request. See also SOAP Attachments. | |
Displays request representations for the request data. ReadyAPI loads representation information from the web service WADL. | |
Use this panel to create and modify custom header fields. NoteThis panel is not available if you specified a JMS endpoint for the request. | |
Displays the Java Message Service headers. NoteThis panel is available if you specified a JMS endpoint for the request. | |
Displays the Java Message Service properties. NoteThis panel is available if you specified a JMS endpoint for the request. |
Once you run the test step, the server response is available in the response editor.
Besides editors and inspectors, you can adjust the test step’s behavior by using its properties in the REST Request Properties and Custom REST Request Test Step Properties panels in the Navigator.
REST Request Properties
Name | Description |
---|---|
Name | The test step’s name. |
Description | Text description of the test step. |
Message Size | Shows the size of the response in bytes. |
Encoding | The encoding of the request data in the |
Endpoint | A URL address of the tested web service. |
Service | The tested service name. |
Resource | The tested resource to which the test step is sent. |
Method | The tested method. |
Timeout | The number of milliseconds to wait for a server response. If there is no response during this period, the test step fails. The 0 or absent value means an infinite wait time. |
Bind Address | The network interface (IP address), through which ReadyAPI will send the request. |
Follow Redirects | Enables handling of redirects. Specify |
Use GET Method on 302 Redirect | If set to ImportantWorks only when the |
SSL Keystore | The file that stores the private keys used to authorize ReadyAPI when connecting to the server. This works for HTTPS requests only. |
Strip whitespaces | Removes comments and extra whitespaces from elements and attributes. Required by some servers. Works for request contents in the XML format. |
Remove Empty Content | Remove empty elements from the request. Works for request contents in the XML format. |
Entitize Properties | Specifies if special characters should be encoded. HTML symbols (like |
Disable Property Expansions | When it is set to |
Multi-Value Delimiter | Sets a delimiter used to separate QUERY parameter values. For example, if you set the parameter name as sample, its value - as test1,test2 and the delimiter - as ,(comma), the query will be |
Pretty Print | When this option is set to TipTo pretty print contents of the JSON panel of the response, right‑click somewhere within the panel and select Format JSON. |
Dump file | Specifies the fully qualified name to the file, to which you want to save the server’s response. Leave this property empty not to save the response to a file. |
Max size | Specifies the maximum number of response bytes that ReadyAPI shows in the editor to save memory. To show the entire response, specify 0. ImportantSpecified assertions may fail, because there will not be enough data for verifying. |
Discard Response | When this option in set to |
Custom REST Request Test Step Properties
This tab contains:
Properties that correspond to the request parameters.
Properties that provide access to the request and response data.
Note
You can load values of custom properties from a file, or save them to a file. To learn more, see About Properties.
Values on the Custom Properties tab are available for other test steps in your project. For instance, you can verify these property values with the Assertion test step or check them and change the execution flow with the Conditional GoTo test step.
Name | Description |
---|---|
Response | The response data without headers. You can see the same content in the response XML panel. To get response data without headers, use the |
RawRequest | The body content of the sent request. You can see the same content in the request Raw panel. Property expansions are converted to the expected values. To get the data with unconverted property expansions, use the |
Endpoint | Duplicates the |
Username | Duplicates the |
Request | The request body without headers. Property expansions are represented as they are without conversion to expected values. To get the sent request with converted property expansions, use the |
HarResponse | The response in the .har format. |
Domain | Duplicates the |
ResponseAsXML | Response data as an XML DOM document (if possible). |
Password | Duplicates the |
RawResponse | Response data with headers. You can see the same content in the Raw panel of the response editor. To get response data without headers, use the |
The test step toolbar contains commands that allow you to modify a test step, change the base REST request or customize appearance of the test step editor.
![]() |
Generate Values
Use the Generate Values button to automatically generate values for parameters in REST request test steps. The value type is deduced from the type of the parameter that is specified in the service definition or, if it's not possible, from the name of the parameter.
To learn more about the feature, see Generate Data Source Automatically.
To add an assertion, use the Add Assertion button on the Request toolbar.
To validate the response content using the data of received responses, click Smart Assertion on the Response editor. To learn more, see Validate response content.
To modify assertions, use the Assertion panel.
The following assertions are available for the REST Request test step:
Name | Description |
---|---|
Property Content: | |
Verifies that the response contains the specified string. | |
Verifies that the value of a property is equal to the specified value. | |
Checks whether the binary response is equal to a file. | |
Counts the occurrences of the specified element. | |
Checks whether the specified element exists. | |
Checks whether the specified element matches an expected value. | |
Checks whether the specified element matches a regular expression. | |
Verifies that the message contains expected contents. | |
Verifies that a response does not contain the specified value. | |
Verifies the message content and metadata such as headers and the status code. | |
Checks whether the result of the specified XPath expression is equal to the specified value. | |
Verifies that a result of the specified XQuery expression is equal to the specified value. | |
Compliance, Status and Standards | |
Checks whether the response contains the expected value of an HTTP header. | |
Verifies that the response contains the specified HTTP header. | |
Checks whether the HTTP status code is not on the specified list. | |
Verifies that a request and response are compliant with the specified JSON schema. | |
Checks whether the response is compliant with the inferred schema. ImportantThe REST Request does not support specifying a schema from a service definition. | |
Verifies that a request and response are compliant with an OpenAPI or Swagger specification. | |
Checks whether the HTTP status code is on the specified list. | |
Script | |
Executes a script to perform a custom assertion. | |
SLA | |
Checks whether the response was returned within the specified timeout. | |
JMS Response | |
Verifies that the JMS request is successful. | |
Checks whether a JMS response returns within a specific time period. | |
Security | |
Verifies that the response does not contain any valuable information. |
While the test step editor is open, brief information on sent requests is listed in the Log tab. If the test step is run as part of a test case, you can see a more detailed log in the Transaction Log panel.
Below, you can find information on common tasks that you can perform with the REST Request test step.
To change a method or the resource path, change the base request:
Click
API on the request editor toolbar.
In the Link REST Request dialog, select the desired request or method and click OK.
Specify a new endpoint in the test step toolbar. By using a drop-down list, you can select one of the endpoints specified on the Endpoint page of the service editor. The following commands of the list allow you to modify the endpoint list:
edit current – changes the selected endpoint.
add new endpoint – adds a new endpoint to the list.
delete current – removes the selected endpoint from the list.
Another way to modify the endpoint is using the Endpoint property.
You can modify request parameter values in the Request panel. These changes will not affect the default values. To restore default values specified in REST Request, click .
To change the parameter name or type, you need to modify the REST request to which this test step refers:
Click
API Request on the request editor toolbar.
Select the desired property and modify it according to your needs.
To load the content of any parameter from a file:
Add the file to the Attachments panel in the request editor.
Get the data by using the property expansion with the following syntax:
file:myFileName.log
:
To specify values in text boxes and cells in the test step editor, you can use the project, test suite, and other property types. To refer to a property, use the following syntax:
${#Project#MyPropertyName}
– Project properties.${#TestSuite#MyPropertyName}
– Test suite properties.${#Env#MyPropertyName}
– Environment properties.
For more information, see Property Expansion.
To add a custom header:
Open the Headers panel of the request editor.
Click
and specify the desired header and its value.
To remove the Content-Length: 0
header from your request, add the -Dsoapui.send.zero.content.length=false
parameter to the vmoptions file located in the <ReadyAPI>/bin
directory and restart ReadyAPI.
To add authorization:
Open the Auth panel of the request editor.
Select the desired Authorization profile.
To learn more about authorization, see Authentication.
To verify that the server returns the expected response, use assertions:
Click Add Assertion on the request editor toolbar.
In the Add Assertion dialog, specify the desired assertion.
Set up a new assertion according to your needs and click OK.