ayongwust 发表于 2006-1-17 16:13:51

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

star1999 发表于 2006-1-23 15:52:17

基于数据驱动的测试代码,不过楼主想干吗呢?

winder238 发表于 2006-3-23 22:01:52

腻了
页: [1]
查看完整版本: a robot automation code