Pages

15 November 2011

SoapUI JDBC Datasource Configuration for MySQL Database

Using each of existing valid test data can be extremely difficult while using huge amount of test data(e.g. 10.000 customers) . SoapUI has datasource feature that automates retrieving test data from existing datasources such as raw files, excel or databases. Accessing huge test data with datasources enhances automated tests with reducing required time to make more tests for finding bugs that are hidden in unexpected cases.
Obviously, raw and excel files hold static data that might possibly become obsolete, since test data is not constant and updated through in test progress. Gathering test data directly from test database solves this problem.
 In order to add JDBC datasource; first, place the jar file of jdbc driver for your database (e.g. mysql-connector-java-5.1.13-bin.jar for MySQL) to %SOAPUI_INSTALL_DIR%\lib, then follow the screenshots below.

1. First add datasource to your test suite in SoapUI, then add a property -> select datasource type as JDBC -> Configure Database Connection

SoapUI - JDBC Datasource Configuration for mysql database
SoapUI - JDBC Datasource Configuration for mysql database

2. Fill Database Configuration Wizard with your own database connection details then test it
SoapUI - Database  Configuration Wizard
SoapUI - Database  Configuration Wizard
3. Optionally, SQL queries can be prepared with SQL Builder Tool in SoapUI.
SoapUI - Build SQL Query
SoapUI - Build SQL Query
Finally, run custom SQL then see the result below where datasource is managed.

No comments:

Post a Comment

Thx for reading! Comments are appreciated...