51Testing软件测试论坛

标题: 调用datapool时的问题 [打印本页]

作者: riverside707    时间: 2006-12-15 17:52
标题: 调用datapool时的问题
回放时,只读数据池中的第一行数据,下面的数据就不再读了,各位高手,可否帮我看一下问题出在哪里?谢谢sdlkfj5
脚本如下:
'$Include "sqautil.sbh"
Sub Main
    Dim Result As Integer
    Dim num As Integer
    Dim Dp_Result As Integer
    Dim Dp_Id As Long
    Dim ET_ID As string
    Dim P_S As string
    Dim x As Integer
    num=InputBox("输入登录的个数:")
    x=1
    while x<=2
    StartApplication "E:\ET5.1\et_cui.exe"
      
      
   Dp_Id=SQADatapoolOpen("login",FALSE,SQA_DP_SEQUENTIAL,FALSE)
   Dp_Result=SQADatapoolFetch(Dp_Id)
   
   DelayFor (3000)
   
      
    Dp_Result=SQADatapoolValue(Dp_Id,"ET_ID",ET_ID)
    Dp_Result=SQADatapoolValue(Dp_Id,"_S",P_S)

    Dp_Result=SQAdatapoolFetch(Dp_Id)

    Window SetContext, "Caption=E:\ET5.1\et_cui.exe", ""
    Window Click, "", "Coords=129,51"
    InputKeys "login 34  client.voipstunt.com 20000 "
    InputKeys ET_ID
    InputKeys " "
    Inputkeys P_S
    Inputkeys "{ENTER}"
    DelayFor (8000)
   
    x=x+1
    wend   
    Dp_Result=SQADatapoolClose(Dp_Id)

End Sub
作者: caoqd    时间: 2006-12-18 14:54
"Dp_Id=SQADatapoolOpen("login",FALSE,SQA_DP_SEQUENTIAL,FALSE)
   Dp_Result=SQADatapoolFetch(Dp_Id)"

试试先执行这两句,然后再循环,就是说把这两句放在循环之外,看看行不.
作者: caesarqth    时间: 2006-12-19 12:15
楼上的是正确的
SQAdatapoolopen在while循环体内,则每次都类似于重新打开datapool,游标会一直在首行
作者: riverside707    时间: 2006-12-20 17:45
多谢咯,嘻嘻




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2