background image
<< Run your data driven testcase | Find and replace values >>

Using all rows and tables

<< Run your data driven testcase | Find and replace values >>
Creating Data Driven Testcases
7
To run a data driven testcase using all rows and tables
Values are text strings, numbers, and booleans (true/false) that exist in your original testcases. One of
the steps in creating a data driven testcase is to find these values and replace them with references to
columns in your data source.
SilkTest checks to make sure that each value you selected is appropriate for replacement by the
column in your testcase. You can turn off this validation by clicking Edit/Data Driven/Validate
Replacements
while you are in a .g.t file. This means that the "Find" aspect of Find and Replace
works as usual, but that the values you Replace are not validated. By turning off this checking you
suppress the error messages that SilkTest would have otherwise displayed. Any 4Test identifier or
fragment of a string is considered an invalid value for replacement unless Validate Replacements is
turned off.
If you are new to creating data driven testcases, we recommend that you keep this validation turned
on.
The goal of this exercise is for you to use the Data Driven Workflow to
·
create a data driven testcase
·
find and replace values in a testcase with links to the data source
·
run the data driven testcase with all rows and tables from the data source
Step 1: Create a data driven testcase
1 Open the GMO application at
http://demo.borland.com/gmopost/
, if it is not already open.
2 Start SilkTest and click File/Open. Browse to <SilkTest installation directory>/examples and
open usability.t.
3 Turn on the Data Driven Workflow bar (if it's not already visible) by clicking Workflows/Data
Driven. On the Data Driven Workflow bar, click Data Drive Testcase. On the Select Testcase
dialog, double click testcase2.
4 On the Specify Data Driven Script dialog, click Create a new file/Overwrite an existing file and
browse to the <SilkTest installation directory>/examples directory. Give the file the name
gentest2, which means you will have to change the default new name.
5 Click Save to save the new file and then click OK when you return to the Specify Data Driven
Script dialog. SilkTest automatically applies the .g.t file extension to that file.
6 On the Select Data Source dialog you tell SilkTest the location of the database you are using to
supply values for the data driven testcase. Accept the default data source, Segue DDA Excel.
At the Select Workbook field, click Browse and select the <SilkTest installation
directory
>/examples/TestExcel.xls and click Open. Click OK on the Select Data Source dialog.
7 On the Specify Data Driven Testcase dialog, click OK to indicate that you want to add a new
testcase named DDA_testcase2 to the gentest2.g.t file you created in Step #3.
Step 2: Find and replace values
1 Underneath the Find/Replace Values dialog, SilkTest displays the gentest2.g.t file in the 4Test
Editor. If you're familiar with the 4Test Editor, you'll notice some changes ­ for example, there's
a Find and Replace resizable menu bar that appears at the top of the 4Test Editor.
You'll notice that there is a section at the top of your file that is collapsed; it contains the code