51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2230|回复: 1
打印 上一主题 下一主题

[Robot] 版主帮个帮,急用,读datapool到第二个数据就读不出了

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2005-3-7 22:02:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏

该用户从未签到

2#
发表于 2005-3-8 09:22:17 | 只看该作者
你的脚本代码编写的不利于调试,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 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-13 17:51 , Processed in 0.072592 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表