Professional Documents
Culture Documents
SilkTest 7.5
A Functionality & Regression Testing Tool
Session – 3
4Test Language
Data Types
Classes
Method Calls
Frequently Used Classes & Methods
Scripting & Standards
Enhanced Coding with examples (Manual Scripting)
Snapfish – Sample Scripts
Different error raising functions
Linking Test Cases to Test Plans
Ex:
BROWSERTYPE btType
lbtType = {explorer4, netscape4}
Classes
The class indicates the type, or kind, of GUI object being declared. Note that this
is the 4Test class, not the class that the GUI itself uses internally.
General Core Classes
General Web Application Classes
ActiveX/VB Classes
Java Classes
.Net Classes
PowerBuilder Classes
Method Calls
A method is a routine that applies to a particular class of objects/window. Once an
object/window is declared, you can refer to it by its identifier when calling methods.
The following example calls the SetActive method on the Find dialog:
Find.SetActive () // Find is a Dialogbox and SetActive is a Method
Browser.Exists() // Browser is a window and Exists is a method
Hungarian notation
Naming convention in which a variable’s name begins with one or more
lowercase letters indicating its data type. For example, the variable name
sCommandLine indicates that the data type of the variable is STRING.
Standards Cont..
Variable prefixes
Variables are specified in Hungarian notation, that is, prefixed with an
abbreviation for the data type. The data types and abbreviations are as
follows:
anytype (a) semaphore (se)
agentoption (ao) string (s)
boolean (b) string or integer (si)
datatype (dt) winstate (ws)
guitype (gt) list of string (ls)
handle (h) list of window (lw)
integer (i) array of anytype (aa)
number (n) array of string or integer (asi).
real (r)
rect (re)
Sample Script
Testcase testcase1.t
Testcase samples() appstate none
Integer iSum,iVal1,iVal2
iSum=0, iVal1=1,iVal2=2
while iSum<=10
iSum=iSum+iVal1+iVal2
Print iSum
Windows_training.inc
Script_training.t
LogWarning function
AppError function
Action: Places an error with the specified error message, proceeded by "***
Error:", into the results file.
Syntax: AppError (sMessage)
Raise statement
Syntax: raise 1,”Navigation to Home Page is not displayed”
Reraise statement
Syntax: reraise
Thank you!