You are on page 1of 3

$Include sqautil.sbh $Include global.

sbh Sub Main Initially Recorded: 2012-1-9 9:53:23 Script Name: Test framework ==================================test the calculator tool Open the calculator StartApplication C:\WINDOWS\system32\calc.exe Do the action by the data of datapool Call ApplicationDatapoolData( FWCalcData ) Do the action by the data of excel Call ApplicationExceldata( 1 ,1) Close the calculator Window SetContext, Caption=Calculator , . Window CloseWin, ., . ===============================test the test classical tool .. End Sub ApplicationDataPoolData sub-function Function ApplicationDataPoolData(datapoolName as string) Initially Recorded: 2012-1-19 5:10:18 Din Reasult As Integer Din dp as variant Din windowobj as string, objecttype as string, takeaction as string, objectproperty as string, sdata as string Din dp_Result as Long

DinEditboxresult as string Dp = SQADatapool10pen (datapoolName) Dp_Result = SQADatapoolFetch (dp) Do until dp_result<>0 Call SQADatapoolValue (dp,1,windowobj) Call SQADatapoolValue (dp,2,objecttype) Call SQADatapoolValue (dp,3,takeaction) Call SQADatapoolValue (dp,4, objectproperty) Call SQADatapoolValue (dp,5,sdata) Select Case (objecttype) Case PushButton Call ProcessPushButton(windowobj,takeaction, objectproperty) Case EditBox Call ProcessEditBox(windowobj,takeaction, objectproperty) Case Menu ..

Function ProcessPushButton(windowobj as string, take action1 as string, objectproperty) Din Result as Integer Select Case(takeaction1) Case Click . Case N .. End select

End function Case Result= SQAGetProperty (Objectproperty, getfield(sdata,1, = ), Edit) Editboxresult=getfield(editboxresult,1, . ) If Editboxresult=getfield(sdata,2, = ) then SQALogMessage sqaPass, the result is correct. It is &Editboxresult, . Else SQA SQALogMessage sqaPass, the result is wrong. It is &Editboxresult, .

You might also like