Applies to ReadyAPI 2.6, last modified on January 15, 2019

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:

AMF Request test step editor

Click the image to enlarge it.

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.
Run a test step to fill this panel.
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. See the Script Panel description.
Tip: You can use project, test suite, or other properties to specify parameter values.
Headers Use this panel to create and modify custom header fields. See Adding Headers and Attachments for more information.
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 Properties and Custom Properties tabs.

Name Description
Name

The test step name.

Description

Text describing the test step.

Discard Response

If true, ReadyAPI deletes the response data from the memory after asserting the result runs. Works only if the test step editor is closed.

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 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.

Test step toolbar

The test step toolbar contains commands that help you modify the test step or appearance of the test step editor.

AMF Request test step toolbar

Click the image to enlarge it.

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.

Specify a new endpoint in the test step toolbar.

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).

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.

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.

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.

To add a custom header:

  1. Open the Headers panel of the request editor.

  2. Click and specify the desired header and its value.

To add a custom AMF header:

  1. Open the AMF Headers panel of the request editor.

  2. 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"

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.

    AMF-Session
  • 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.

To verify that the server returns the expected response, use assertions:

  1. Open the Assertions panel in the test step editor and click Add.

  2. In the Add Assertion dialog, specify the desired assertion.

  3. Configure a new assertion according to your needs and click OK.

See Also

AMF Options
Test Steps

Highlight search results