About step
The AMF Request test step can be used to send requests of the Action Message Format (AMF) over HTTP or HTTPS.
Editing AMF Request test step
You can modify settings of a test step in its editor:
Here is a brief description of available panels in the request editor:
Name | Description | ||
---|---|---|---|
Raw | Displays a request header and body in a text format.
|
||
AMF | Displays request parameters in a table. You can examine and change request parameters. In the table, you specify parameters of basic types – integer, string, and so on. To send an object or an array to the server, write a script that creates needed objects and assigns them to the desired parameters before sending.
|
||
Headers | Use this panel to create and modify custom header fields. | ||
AMF Headers | Use this panel to create and modify custom AMF header fields. |
After you run a test step, the server response is available in the response editor.
Property list
Besides the test step editor, you can adjust test step behavior by using the properties on the AMF Request Test Step Properties and Custom AMF Request Test Step Properties panels in the Navigator.
AMF Request Test Step Properties | View ↓
Name | Description |
---|---|
Description |
Text describing the test step. |
Discard Response |
If |
Name |
The test step name. |
Name | Description |
---|---|
Name |
The test step name. |
Description |
Text describing the test step. |
Discard Response |
If |
Custom AMF Request Test Step Properties | View ↓
This tab contains the following properties:
-
Properties that correspond to the request parameters.
-
Properties that provide access to the request and response data.
You can modify, add, remove, and change custom properties, load their values from a file or save them to a file. To do this, use the toolbar items. See below for more information.
Values on the Custom AMF Request Test Step Properties tab are available to other test steps in your project. For example, you can verify these property values by using the Assertion test step, or check them and change the execution flow with the Conditional GoTo test step.
Name | Description |
---|---|
ResponseAsXml |
Provides access to the response data. The server response to an AMF request has the XML format. The property returns a hierarchy of XML nodes returned by the server. You can use this property to verify the response data. |
Name | Description |
---|---|
ResponseAsXml |
Provides access to the response data. The server response to an AMF request has the XML format. The property returns a hierarchy of XML nodes returned by the server. You can use this property to verify the response data. |
Test step toolbar
The test step toolbar contains commands that help you modify the test step or appearance of the test step editor.
Here is a brief description of some commands:
-
AMF Call – To specify a call, use the
object.methodName
format.
Verifying response
To add, change, or modify assertions, use the Assertion panel. Use the following assertions:
Name | Description |
---|---|
Property Content: | |
Contains | Verifies that the response contains the specified string. |
Equals | Verifies that the value of a property is equal to the specified value. |
Equals (Binary) | Checks whether the binary value of the response is equal to a file or another response. |
Message Content Assertion | Verifies that the message contains expected contents. |
Not Contains | Verifies that the response does not contain the specified value |
XPath Match | Verifies that the result of the specified XPath expression is equal to the specified value. |
XQuery Match | Verifies that the result of the specified XQuery expression is equal to the specified value. |
Compliance, Status and Standards | |
HTTP Header Equals | Checks whether the response contains the expected value of an HTTP header. |
HTTP Header Exists | Verifies that the response contains the specified HTTP header. |
Script | |
Script Assertion | Executes a script to perform a custom assertion. |
SLA | |
Response SLA | Checks whether the response was returned within the specified timeout. |
Logging
If the test step is run as part of a test case, you can see the detailed log in the Transaction Log panel.
Working with
Below, you can find information on common tasks that you can perform with the AMF Request test step.
Change endpoint
Specify a new endpoint in the test step toolbar.
Modify request parameters
Change request parameters in the AMF panel. Use the toolbar buttons to add, remove parameters, clear parameter values and change their order. You can also import a list of parameters from a file and export them to it (see below).
Export parameters to file
To export parameters to a file, click and specify the file to which you want to save the request parameters.
Note: | ReadyAPI exports the list of the request parameters and the ResponseAsXML custom property. |
Load parameters from file
To import parameters from a file:
-
Click
.
-
In the ensuing Load Properties dialog, specify the file to be imported.
-
If the file contains properties that are not specified in the request, ReadyAPI can create them. For this, enable the Create Missing option.
-
If the request contains properties that are not specified in the file, ReadyAPI can remove them. For this, enable the Delete Remaining option.
![]() |
Loading parameters from a file do not affect the ResponseAsXML custom property, even if it is specified in the file. |
Use property expansion in properties
To specify values in text boxes and cells of 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 Expansions.
Add custom headers
To add a custom header:
-
Open the Headers panel of the request editor.
-
Click
and specify the desired header and its value.
Use AMF headers
To add a custom AMF header:
-
Open the AMF Headers panel of the request editor.
-
Click
and specify the desired header and its value.
To modify the AMF header, change its value in the AMF Headers panel or use the amfHeaders scripting object. For example, the code snippet below modifies the foo AMF header:
Groovy
amfHeaders["foo"] = "New Value"
Use AMF session
You can reuse the AMF session connection in multiple tests.
-
Open your test case that contains the desired AMF Request steps.
-
Click the
Options button.
-
In the TestCase Options dialog, open the AMF tab and enable the AMF Session option and specify session parameters:
-
Endpoint – Specifies the endpoint to which requests will be sent.
-
Username – The user name used for authorization.
-
Password – The password used for authorization.
-
Now, ReadyAPI logs in to the specified AMF service before the first test step and logs out after the last test step in the test case.
The authorized AMF connection is shared among all AMF Request test steps in the test case.
Verify response
To verify that the server returns the expected response, use assertions:
-
Open the Assertions panel in the test step editor and click
.
-
In the Add Assertion dialog, specify the desired assertion.
-
Configure a new assertion according to your needs and click OK.