5. Get Data From the MySQL Database

Applies to ReadyAPI 3.9, last modified on July 30, 2021

Now you have a test case and a project, so you can create the Data Source test step.

  1. Select your new test case.

  2. Add the Data Source test step.

    ReadyAPI: Adding the data source test step

    Click the image to enlarge it.

  3. ReadyAPI will suggest that you add the Data Source Loop test step. In this tutorial, you will add it manually later, so click No.

  4. Open the Data Source test step and select the JDBC data source type.

    ReadyAPI: Selecting the type of the data source

    Click the image to enlarge it.

  5. Open the Configuration Panel.

  6. To configure the connection string, click Configure.

    ReadyAPI: Opening the Database Configuration dialog

    Click the image to enlarge it.

  7. In the Database Configuration dialog, select the MySQL JDBC driver.

    ReadyAPI: The Database Configuration dialog

    Click the image to enlarge it.

  8. Specify the settings of your MySQL Server: the host, port and so on.

  9. In the Database field, specify the sample MySQL database.

  10. Click Test connection to verify the settings are correct.

  11. Click Yes in the Change Connection Properties dialog.

  12. The Build SQL Query wizard will appear.

    ReadyAPI: The Build SQL Query wizard

    Click the image to enlarge it.

    Select the city table in the list of tables and check the Name column in the list of table columns.

  13. Click OK to add your new query to the data source configuration. This will create a property value.

    ReadyAPI: The JDBC data source configuration

    Click the image to enlarge it.

  14. For this tutorial, you need to set a limit for the amount of data you will get from the database.

    Click in the data source toolbar at the top.

    ReadyAPI: Opening the data source test step options

    Click the image to enlarge it.

  15. On the Settings tab, set End Row to 5.

    ReadyAPI: Setting the row limit

    Click the image to enlarge it.

  16. Click OK.

Now you can use the data source data in your request.

Prev          Next

See Also

MySQL Databases as Data Sources

Highlight search results