background image
<< Testcase - Testing the application state | Testcase - BOOLEAN value >>
Testcase - Using data-driven testcases
<< Testcase - Testing the application state | Testcase - BOOLEAN value >>
User's Guide
8 G
Using data-driven testcases
Select the application state you want to run and click Run.
If there are compilation errors, SilkTest displays an error window. Fix the
errors and rerun the application state.
Using data-driven testcases
SilkTest uses the term data-driven testcase to refer to a testcase that is passed
data. To understand the motivation for creating data-driven testcases, take a
look at the following testcase, which is not data-driven:
Example of a non-
data-driven testcase
testcase FindTest ()
TextEditor.File.New.Pick ()
DocumentWindow.Document.TypeKeys ("Test Case<HOME>")
TextEditor.Search.Find.Pick ()
Find.FindWhat.SetText ("Case")
Find.CaseSensitive.Check ()
Find.Direction.Select ("Down")
Find.FindNext.Click ()
Find.Cancel.Click ()
DocumentWindow.Document.VerifySelText (<text>)
TextEditor.File.Close.Pick ()
MessageBox.No.Click ()
The chief disadvantage of this kind of testcase is that it tests only one out of
the many possible sets of input data to the Find dialog. Therefore, to
adequately test the Find dialog, you must record or hand-write a separate
testcase for each possible combination of input data that needs to be tested. In
even a small application, this creates a huge number of testcases, each of
which must be maintained as the application changes.