background image
<< Test Frame - Defining a method for a GUI object | Test Frame - Defining a data structure for an object >>
Test Frame - SetLineNum method
<< Test Frame - Defining a method for a GUI object | Test Frame - Defining a data structure for an object >>
98
User's Guide
4 R
ECORDING
A
T
EST
F
RAME
Defining a method for a GUI object
3
Name the method by typing the name or selecting one of the predefined
methods: BaseState, Close, Invoke, or Dismiss.
4
Record the actions that make up the method.
5
Edit the 4Test statements that were recorded, if necessary.
6
Paste the code to your include file.
Example
For example, suppose you want to create a method named SetLineNum for a
dialog named GotoLine, which does the following:
·
Invokes the dialog
·
Enters a line number
·
Clicks the OK button
The following 4Test code shows how to add the definition for the
SetLineNum method to the GotoLine dialog's declaration:
window DialogBox GotoLine
tag "Goto Line"
parent TextEditor
const wInvoke = TextEditor.Search.GotoLine
void SetLineNum (STRING sLine)
Invoke ()
// open dialog
Line.SetText (sLine) // populate text field
// whose identifier is Line
Accept ()
// close dialog, accept values
Then, to go to line 7 in the dialog, you use this method call in your testcases:
GotoLine.SetLineNum (7)