a robot automation code
'$Include "sqautil.sbh"Sub Main
Dim Result As Integer
'Initially Recorded: 1/17/200612:29:15 PM
'Script Name: testScriptForDP
dim x as integer
dim num1 as string
dim num2 as string
dim sum as string
dim dp as long
'call the calculator
startApplication "C:\WINNT\system32\calc.exe"
'open data pool
dp= SQADatapoolOpen("testData")
for x=1 to 4
call SQADataPoolFetch(dp)
'read data from data pool
call SQADatapoolValue(dp,1,num1)
call SQADatapoolValue(dp,2,num2)
call SQADatapoolValue(dp,3,sum)
'assign data which we read from data pool to variables respectively
WindowSetContext,"Caption=Calculator",""
InputKeys num1 & "{+}" & num2 & "{ENTER}"
Result = LabelVP (CompareNumeric, "Text=" & sum & ".", "VP=Alphanumeric;Value=" & sum & ".")
if Result=1 then 'if success ,give the user success information
MsgBox "successful"
end if
next
Call SQADatapoolClose(dp)
Window CloseWin, "", ""
End Sub 基于数据驱动的测试代码,不过楼主想干吗呢? 腻了
页:
[1]