|
One of the major time consumers when testing applications is
going through lots of different data sets in order to test the functionality of
a Web Service.
This is easily solved in soapUI Pro with the DataSource TestStep
where you can connect to a data source and feed the Web Service with data.
Here is a tutorial that describes how to use Microsoft SQL Server as a source
these tests. We will even thrown MySQL in for free.
Let us show you how to!
Using the DataSource TestStep is not that hard in general,
but what can be difficult is using the right connection string and how to use
the driver itself. Both issues will be explained here. But, let’s start from
the beginning.
Prereqs
In our example we have the following;
- A Microsoft SQL Server database (db_author) instance with one table, tb_author. we'll also see in the end how to do this with MySQL.
- The Amazon.com Web Service
- A settings file containing login data
All these can be gotten by downloading the Tutorial .zip.
Preparation
Step 1, The MS SQL Server
If you don’t have an installation of MS SQL, use the download links here or read on, this tutorial is useful for MySQL as well.
Step 2, The Driver
First we need a JDBC driver, you can get that here .
Then unzip the file and put the driver, named sqljdbc.jar, either in your JAVA HOME/lib/ext or in soapUI/jre/
lib/ (for example C:\Program Files\eviware\soapUI-Pro-1.7.1\jre\lib\ext).
If you have soapUI running, restart it so that it can reload
all drivers.
Step 3, The database.
OK, we need a database, so let’s make something simple to
illustrate the functionality.
As usual we’ll use the Amazon Web Services to
illustrate the functionality.
We’ll make a database called db_author containing one table
called tb_author.
This table contains two fields, one called index and one
called author. Like seen here.
That is all we need, let's start soapUI and get testing!
Let's get coding! >>>
|