background image
<< Adding Data to a Testplan | Updating Testplan - Specifying data that is unique to a single test description >>
Updating Testplan - Linking a testplan to a data-driven testcase
<< Adding Data to a Testplan | Updating Testplan - Specifying data that is unique to a single test description >>
222
User's Guide
10 A
DDING
D
ATA
TO
A
T
ESTPLAN
Linking a testplan to a data-driven testcase
Linking a testplan to a data-driven testcase
Two ways to link a
plan to a testcase
To link a group of test descriptions in the plan with a data-driven testcase, add
the testcase statement to the group description level. There are two ways to
do this:
·
Use the Testplan Detail dialog to automate the process.
·
Enter the testcase statement manually.
Note For details on each of these methods, see "Linking the testplan
to scripts and testcases" on page 61.
For example, consider the data-driven testcase FindTest, which takes a record
of type
SEARCHINFO
as a parameter:
type SEARCHINFO is record
STRING
sText
// Text to type in document window
STRING
sPos
// Starting position of search
STRING
sPattern
// String to look for
BOOLEAN bCase
// Case-sensitive or not
STRING
sDirection // Direction of search
STRING
sExpected
// The expected match
testcase FindTest (SEARCHINFO Data)
TextEditor.File.New.Pick ()
DocumentWindow.Document.TypeKeys (Data.sText + Data.sPos)
TextEditor.Search.Find.Pick ()
Find.FindWhat.SetText (Data.sPattern)
Find.CaseSensitive.SetState (Data.bCase)
Find.Direction.Select (Data.sDirection)
Find.FindNext.Click ()
Find.Cancel.Click ()
DocumentWindow.Document.VerifySelText ({Data.sExpected})
TextEditor.File.Close.Pick ()
MessageBox.No.Click ()