6. Set the Data Sink Test Step

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

At this step, we will add a Data Sink test step and configure it to save the data to the database.

1. Get the response

To begin, you need to simulate a request and get some sample responses. ReadyAPI will use the data to automatically configure assertion properties.

Switch to the test case editor and click Run test case on the editor toolbar:

ReadyAPI: Running the test case

2. Create a data sink

  1. Open the test case and add the data sink test step.

    ReadyAPI: Adding the data sink test step

    Click the image to enlarge it.

  2. To store data in the data sink, you have to place the data sink after the request. The data source loop, in its turn, should be placed after both these steps in order for these to work properly in every iteration of the loop.

    To move the test step, drag it to the needed place in the Navigator:

    ReadyAPI: Moving the data sink test step

    Click the image to enlarge it.

  3. Set the data sink type to JDBC.

  4. The Data Sink test step can use a project-wide JDBC connection or a specific connection for this test case.

    In this tutorial, we will use a test case-specific connection. Click Configure to set up the connection:

    ReadyAPI: Configuring the data sink test step

    Click the image to enlarge it.

  5. The Database configuration dialog appears.

    First, you need to select the driver. Select the pre-configured MySQL driver:

    ReadyAPI: Selecting the MySQL driver

    Click the image to enlarge it.

  6. Specify the remaining settings you use to access your MySQL server. In the Database field specify the datasink database:

    ReadyAPI: Configuring the database connection

    Click the image to enlarge it.

  7. Click Test connection to verify whether the settings are correct.

  8. After you finish the configuration, ReadyAPI will suggest that you build the query. Click Yes:

    ReadyAPI: The New Connection Properties dialog
  9. The Create Query dialog appears.

    Here, specify the tutorial table and check the id and team columns.

    ReadyAPI: Query creation wizard

    Click the image to enlarge it.

  10. Enable the Add Properties property to add the property you need automatically.

  11. Click OK.

ReadyAPI creates the SQL query and the properties.

ReadyAPI: The new query and property

Click the image to enlarge it.

Now, you can transfer the data.

Prev          Next

See Also

Store Data

Highlight search results