8. Insert Data Into a Request

Applies to ReadyAPI 3.7, last modified on April 08, 2021

You specify request data in the request editor. The editor offers several tab pages that display parameters, headers, and body in different formats. Let’s see how it works.

Test the request

Let’s test our request first:

  1. Open the Request 1 step editor, and switch to the Form tab:

    ReadyAPI: The request test step Form view

    Click the image to enlarge it.

  2. Type some city name into the address box, for example, Stockholm:

    ReadyAPI: Entering the data in the request

    Click the image to enlarge it.

  3. Click on the editor toolbar to send the request.

If the endpoint is specified correctly, you will see the response contents:

ReadyAPI: The request test step with the Outline response

Click the image to enlarge it.

Insert property values

To refer to a property, you use a property expansion expression like this:

Data-driven testing of web services with ReadyAPI: Property Expansion

The test engine will “expand” this expression and insert the property value before sending the request. For complete information on this functionality and supported syntax, see Property Expansion.

You can either type the expression manually, or select a property visually by using the Get Data command. The latter is available if you have a ReadyAPI Test license, trial or commercial. Let’s see how this command works:

  1. Click the ellipsis button in the address edit box:

    Data-driven testing of web services with ReadyAPI: Calling the Get Data dialog

    Note: Some editors and dialog boxes have the Get Data command in the context menu, some others offer both the ellipsis button and the menu command:

    Data-driven testing of web services with ReadyAPI: The Get Data command in the context menu
  2. In the subsequent Get Data dialog:

    • Select your test case, the Data Source test step and the Person_Address_City property.

    • Click Add.

    Data-driven testing of web services with ReadyAPI: The Get Data dialog box

    Click the image to enlarge it.

That’s all. ReadyAPI will insert the property expansion expression into the address edit box:

ReadyAPI: A request field with the property expansion

Click the image to enlarge it.

Now, if you run the request, this expression will be replaced with data from your data source.

You are now ready to add the data source loop to your test case.

Prev          Next

See Also

Microsoft SQL Databases as Data Sources

Highlight search results