Now, you have a project with a test case and a default data source test step. You can change it to use a JDBC connection to the database.
-
Open the test step and in the Data Source drop-down, select JDBC.
-
Now, you can configure settings of the JDBC data source.
First, you need to decide if you want to use a project-wide JDBC connection, or use a specific connection for this test case.
Working with this tutorial, you should use a test case-specific connection.
-
Click Configure.
-
The Database Configuration dialog appears.
First, you need to add the driver.
The driver will only be available if you placed it in the bin/ext directory.
Select the jTDS driver.
-
Now, you can add the remaining connection information, according to the connection template. Use the following table to do that:
Host 127.0.0.1
Port 1433
Database AdventureWorks2014
-
Click Test connection to verify that the settings are correct.
-
Click OK.
-
Click OK again.
ReadyAPI will now offer you to use the Query Builder to create a database query from the actual database contents. Usually, you will do that right away, but for purposes of this tutorial, skip it for now. To do that, click No.
You have set up the connection.
Now, you can set up a limit for the data retrieval.
Troubleshooting
If the connection test fails:
-
Verify that your settings are correct.
-
Make sure the driver and dll are in the correct place.
-
Make sure the database server is installed and running on the correct port.