标题: 请教:Robot gui 脚本中datapool出现的问题 [打印本页] 作者: dragonhua 时间: 2005-12-7 11:26 标题: 请教:Robot gui 脚本中datapool出现的问题 计算器例子(我的是乘法),详细过程如下:
1.我在testmanager 设置datapool为dp1,字段num1,num2,sum 均为整型,seed为不同的随机数,且数据已经生成。
2.我先录制完脚本,脚本如下:
Sub Main
Dim Result As Integer
Result = EditBoxVP (CompareNumeric, "Name=Text3", "VP=Alphanumeric;Value=2000000")
PushButton Click, "Name=Command2"
End Sub
然后我将“Value=2000000”改为“20”,进行回放,PASS。
3.我再次修改脚本,脚本如下(或见附件):
Sub Main
Dim Result As Integer
dim x as integer
dim num1 as string
dim num2 as string
dim sum as string
dim dp as long
'Initially Recorded: 2005-12-7 10:21:17
'Script Name: 3
StartApplication """F:\tested\vb test\Project1.exe"""
dp=SQADatapoolOpen("dp1")
for x=1 to 5
Call SQADatapoolFetch(dp)
Call SQADatapoolValue(dp,1,num1)
Call SQADatapoolValue(dp,2,num2)
Call SQADatapoolValue(dp,3,sum)