Configure Data Sources in Virtual Services

Applies to ReadyAPI 3.56, last modified on November 21, 2024

You configure Data Sources on the Data Sources page:

Service virtualization and API testing: Using data sources in virtual services

Click the image to enlarge it.

Each data source has properties. They correspond to data source columns and provide access to the data source’s data.

Configure Data Sources

  1. Switch to the Data Sources page of the virtual service editor. Click on the page toolbar and specify the data source name in the subsequent dialog box. You will use this name to refer to a data source:

    Service virtualization and API testing: Creating data sources

    Click the image to enlarge it.

  2. Select the data source type and specify connection settings:

    Service virtualization and API testing: Configuing data source connection settings

    Click the image to enlarge it.

    The connection settings are common across ReadyAPI tools. For detailed information, see Data Source Reference.

  3. Create properties for the data source. The properties provide access to the data source’s data. If your data source is based on an Excel sheet, on a database or a comma-separated value (CSV) file, the property names you enter must coincide with column names of the data source.

    ReadyAPI automatically suggests importing property names from the data source after you finish configuring the connection settings. We recommend accepting this suggestion. If you decline it, you can import properties any time later by clicking the button or create properties manually by clicking on the property list toolbar:

    Service virtualization and API testing: The Add Property command

    Click the image to enlarge it.

    We would like to remind that property names must coincide with the data source’s column names.

    Tip: For REST service users: If the response body you defined contains a JSON object, you can create data source properties from this object – simply click in the Data Source section of the response editor. This will create data source properties whose names coincide with the property names of the object. You can add the properties to a new data source or to an existing one:
    Service virtualization and API testing: Create data source properties from JSON response

    Click the image to enlarge it.

After you set up data source settings and created properties, you can use the properties in responses.

Configure Data Source Options

  1. Select the data source you want to configure. Click to open the configuration dialog.

    Service virtualization and API testing: Setting up data source options

    Click the image to enlarge it.

  2. Set up the options:

    • Trim – Commands the data source to remove leading and trailing spaces from the retrieved text values.

    • Entitize – Commands the data source to replace special HTML symbols (like & or >) with the appropriate entities (like & or >).

See Also

Data Sources in Virtual Services

Highlight search results