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
189
8 G
ENERALIZING
A
T
ESTCASE
Using data-driven testcases
2
Select the application state you want to run and click Run.
3
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>)
Case
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.