版主帮个帮,急用,读datapool到第二个数据就读不出了
dp=SQADatapoolOpen("ID_Data")for x=1 to 2
Call SQADatapoolFetch(dp)
'从数据池中读取记录
Call SQADatapoolValue(dp,1,ID)
'将从数据池中读取的数据赋予相应变量
Call SQADatapoolClose(dp)
'关闭数据池
'=================================
URLa=ID
URLb="www.cnta.com/10-lxs/view.asp?id="
URL=URLb+URLa
StartBrowser URL, "WindowTag=WEBBrowser"
DelayFor (15000)
Window SetTestContext, "Caption=中国旅游网 - Microsoft Internet Explorer", ""
Result=SQAGetProperty("Type=HTMLTableCell;Index=8","innerText",manager)
Result=SQAGetProperty("Type=HTMLTableCell;Index=10","innerText",commissary)
Result=SQAGetProperty("Type=HTMLTableCell;Index=12","innerText",address)
Result=SQAGetProperty("Type=HTMLTableCell;Index=14","innerText",post)
Result=SQAGetProperty("Type=HTMLTableCell;Index=16","innerText",Email)
Result=SQAGetProperty("Type=HTMLTableCell;Index=18","innerText",tel)
Result=SQAGetProperty("Type=HTMLTableCell;Index=20","innerText",license)
Result=SQAGetProperty("Type=HTMLTableCell;Index=22","innerText",fax)
sum=manager+"/"+commissary+"/"+address+"/"+post+"/"+Email+"/"+tel+"/"+license+"/"+fax
open "c:\Test.txt" for Append as #1
print #1,sum
close #1
Window CloseWin, "", ""
next
Call SQADatapoolClose(dp)
我读到第二个就读不出了,我数据池中只有两个数据,为什么呢,请版主帮忙
[ Last edited by djw1999 on 2005-3-7 at 22:31 ] 你的脚本代码编写的不利于调试,datapool的调用没有返回值!到底是否调用成功,你无法确认!
代码如下:
'$Include "sqautil.sbh"
DIM dp_id as Long
DIM dp_Result as Long
dp_id = SQADatapoolOpen ("repo_dp1", FALSE, SQA_DP_SEQUENTIAL, FALSE)
dp_Result = SQADatapoolFetch (dp_id)
dp_Result = SQADatapoolClose (dp_id)
你调试的过程中,察看variable窗口,dp_result返回值是否成功!才能判断是否读取成功!
页:
[1]