|
我在测试的时候,datapool中有几十个数据,但只能读取第一行的数据:下面是代码:
'$include "sqautil.sbh"
Sub Main
Dim Result As Integer
Dim strOperatorid As String
Dim i As Integer
Dim dp_id As Long
Dim dp_Result as Long
Dim x as Integer
'Initially Recorded: 2005-3-17 17:27:16
'Script Name: 添加操作员
StartBrowser "http://192.168.1.96/index.jsp", "WindowTag=WEBBrowser"
Window SetContext, "WindowTag=WEBBrowser", ""
Browser SetFrame,"Type=HTMLFrame;HTMLId=left",""
Browser NewPage,"",""
HTMLImage Click, "Type=HTMLImage;Name=myTocnodeIcon10", "Coords=10,9"
HTMLLink Click, "Type=HTMLLink;HTMLText=添加操作员", ""
Window WMaximize, "", ""
Browser SetFrame,"Type=HTMLFrame;HTMLId=main",""
Browser NewPage,"HTMLTitle=添加操作员",""
EditBox Click, "Type=EditBox;Name=operatorid", "Coords=10,8"
dp_id = SQADatapoolOpen ("datapool", FALSE, SQA_DP_SEQUENTIAL, FALSE)
' username = SQADatapoolFetch("datapool",1,1)
' username = SQADatapoolFetch(dp_id)
dp_Result = SQADatapoolFetch (dp_id)
while dp_Result <> sqaDpEOF
dp_Result = SQADatapoolValue (dp_id, "operatorid", strOperatorid)
dp_Result = SQADatapoolFetch (dp_id)
inputkeys strOperatorid
EditBox Click, "Type=EditBox;Name=realname", "Coords=11,9"
InputKeys "dong"
EditBox Click, "Type=EditBox;Name=password", "Coords=91,16"
InputKeys "111"
EditBox Click, "Type=EditBox;Name=password1", "Coords=46,11"
InputKeys "111"
EditBox Click, "Type=EditBox;Name=tel", "Coords=73,7"
InputKeys "13520589320"
EditBox Click, "Type=EditBox;Name=email", "Coords=31,7"
InputKeys "caixw@ort.com.cn"
RadioButton Click, "Type=RadioButton;Name=isdisabled;Index=2"
PushButton Click, "Type=PushButton;Name=yes"
Window SetContext, "Caption=Microsoft Internet Explorer", ""
PushButton Click, "Text=确定"
wend
dp_Result = SQADatapoolClose (dp_id)
End Sub |
|