Configuring for JDBC TestStep

Configuring for JDBC TestStep

Discussed below is a quick explanation of how the JDBC test step can be used with the soapui tool.

JDBC Test Step is an option we can use within the SoapUI Test case to gain access to a database and run sql queries. The below explanation discusses how we can achieve this.

Before starting soapui, access the path  soapui-x.x.x/bin/ext and add the mysql jar. For this example I am using the version mysql-connector-java-5.1.21-bin.jar

Once soap ui is started, If the need is to add a set of test cases to a request, right click on the request and select the option "Add to Testcase" this will then add a new test suit if none exist and also add a test case with the given name.

Next, once the test case is added, right click on the test case and select "Add Step" option, hear you will be shown a list of steps we can add for a test case. For our need lets select "JDBC Request" as the test step.




Once we select JDBC test step, we need to now specify the driver name and the connection string as shown below:


Note: 
(1) The Connection String format should be :
jdbc:mysql://localhost:3306/DATABASE_NAME
?user=DBUSER_NAME&password=DB_PASSWORD
(2) When we specify the sql query we can give as databa-sename.table name or just the table name within the sql query we want to run.



Comments