|
我根据海龙楼主的要求完成测试脚本的修改,但在回放时去并不能顺利的求出SUM 的值,错误提示为:SHARED datapool access is not,available fro datapool 'jsq'
我的操作过程如下:
先录制脚本,并完成修改,然后在testmanager中定义的数据池jsq ,包含三列,num1,num2和sum (的数据类型均为Integers - Signed),自动生成测试数据,退出datapool.录制后修改的脚本如下:
'$Include "sqautil.sbh"
Sub Main
Dim Result As Integer
'**** add ****
dim dp as long
dim x as integer
dim num1 as string
dim num2 as string
dim sum as string
'******add ***
'Initially Recorded: 2005-2-16 13:46:00
'Script Name: 计算器
StartApplication "C:\WINNT\system32\calc.exe"
dp=SQADatapoolOpen("jsq")
for x=1 to 5
Call SQADatapoolFetch(dp)
Call SQADatapoolValue(dp,1,num1)
Call SQADatapoolValue(dp,2,num2)
Call SQADatapoolValue(dp,3,sum)
Window SetContext, "Caption=计算器", ""
InputKeys num1 &"{+}"& num2 &"{ENTER}"
Result = SQAGetProperty ("Type=Label;ObjectIndex=1", "Text", sum)
next
Call SQADatapoolClose(dp)
End Sub
请高手指点,错在那里?先谢了!
[ Last edited by njalic on 2005-2-16 at 15:31 ] |
|