background image
<< Tutorial 4. Data Driven Workflow | Data driven testcases >>

Overview of Data Driven Testing

<< Tutorial 4. Data Driven Workflow | Data driven testcases >>
4
Creating Data Driven Testcases
Overview of Data Driven Testing
A data driven testcase lets you store data combinations in a list of items and invoke the testcase once
for each item, passing the data to the testcase as a parameter. You can think of a data driven testcase
as a template for a class of testcases. The benefits are easy to see:
·
Data driven testcases reduce redundancy in a testplan.
·
Writing a single testcase for a group of similar testcases makes it easier for you to maintain
scripts.
·
Data driven testcases are reusable; adding new tests only requires adding new data.
You can now use the Data Driven Workflow to help you create data driven testcases that use data
stored in databases. Previous versions of SilkTest explained how to store data in a testplan, how to
type in the data at the time you are running the testcase, and how to pass in data from an external file.
While those techniques still work, we strongly recommend that you now use the Data Driven Workflow
which generates much of the necessary code for you and guides you through the required steps.

You turn the Data Driven Workflow on and off by clicking Workflows/Data Driven; the Data Driven
Workflow looks like this:
Before you begin
There are several things you need to do before you start working with data driven testcases:
·
Get the files needed by the exercise. To do this, go to your <SilkTest installation
directory>/examples directory and unzip the ddw.zip file into that same directory. The following
files should now be in your <SilkTest installation directory>/examples directory:
testexcel.xls
usability.t
gentest1_example.g.t
gentest2_example.g.t
gentest1_example.res gentest2_example.res
frame.inc
·
Take a look at the MS Excel file used as the database by this exercise by opening testexcel.xls
located in the <SilkTest installation directory>/examples directory. If you don't find this file in
this directory, you haven't unzipped the files as described in the first step above.

In testexcel.xls, notice that there are three worksheets: Products, Customers, and CreditCards.
Each of these worksheets contains several columns of data. For example, on the Products
worksheet, there are columns named Desc, Blurb, NumInStock, QtyToOrder, and OnSale.
·
Be sure that you have the correct DSN available: Segue DDA Excel. This is automatically set
up when you install SilkTest, but please check. On Windows, for example, click
Start/Settings/Control Panel/Administrative Tools/Data Sources (ODBC). Click the
System DSN tab and verify that the Segue DDA Excel driver is listed. This is the default DSN
used by the Data Driven Workflow and, coincidentally, the one used by these exercises.
·
Be familiar with the GMO application, if you aren't already. You can locate this application at:
http://demo.borland.com/gmopost/