background image
<< Using all rows and tables | Tutorial 5. Working with Java Applications >>

Find and replace values

<< Using all rows and tables | Tutorial 5. Working with Java Applications >>
8
Creating Data Driven Testcases
that SilkTest writes including the DSN connection, sample data, and other necessary
information:(
[+] // *** DATA DRIVEN ASSISTANT Section (!! DO NOT REMOVE !!) ***

To see the code that SilkTest creates, click the [+] to expand that section. Do NOT edit any of
the information contained in this section.
2 Now you need to indicate the names of the table and column that contain values that you want
to link to. You can do that with either the Find/Replace Values dialog or via the Find and
Replace resizable menu bar; this exercise uses the Find/Replace Values dialog.

On the Find/Replace Values dialog select Customer$ from the drop down list of tables and
Address from the drop down list of columns. Click Find Next to start searching for addresses
within the testcase.
3 SilkTest finds and highlights various values, click Find Next until SilkTest highlights 201 Spring
street. Since this is an address, click Replace on the Find/Replace Values dialog to replace that
number with a value from the data source.
4 There is only one address in this testcase, so you can now start searching for Name.
a. On the Find/Replace Values dialog, select Name from the Column list.
b. Click Find Next until SilkTest highlights "Susan". Remember that you may have to change
the direction of your search by clicking Up on the Find Replace Values dialog to locate this
value.
c. Click
Replace on the Find/Replace Values dialog to replace that name with a link to the
values in the data source
5 Now search for and replace Zip codes in your script.
a. On the Find/Replace Values dialog, select Zip from the Column list.
b. Click Find Next until SilkTest highlights "02421". Remember that you may have to change
the direction of your search.
c. Click
Replace on theFind/Replace Values dialog to replace that zip code with a link to the
values in the data source.
6 You're done replacing values, so click Cancel on the Find/Replace Values dialog.
Step 3: Run your data driven testcase
1 Click Run Testcase on the Data Driven workflow bar and select DD_testcase2.
2 Click Run to run all rows.
Result
Testcase2 should have run six times. Compare your files with the gentest2_example.g.t and
gentest2_example.res found in the <SilkTest installation directory>/examples directory.