Overview - 4Test code
The 4Test language
Example The following 4Test code shows how to use the if statement to
conditionally execute a method. The code picks the Close menu item from
the File menu of the Text Editor application, which causes a message box to
appear if there is unsaved work. The if statement tests for the existence of the
if MessageBox.Exists ()
// if the message box exists
MessageBox.No.Click () // then dismiss it
Data types and variables
Built-in data types
4Test provides the following built-in data types:
For complete information about all 4Test data types, see the online Help.
C data types for DLL
In addition to the 4Test data types, the following C data types are supported
for use in calling functions in DLLs.
The first two columns above show data types that correspond to the 4Test
data type. The third column corresponds to the
You can also create new data types, including enumerated types and records.
type FILE is LIST OF STRING
type COLOR is enum
Adding variables to a
In the following testcase a record data type is defined that contains each of
the data values the testcase needs. The methods in the testcase process fields
from the record instead of literal data values.