51Testing软件测试论坛

标题: 测试中从datapool中读取数据的问题,只能读取第一行的数据??? [打印本页]

作者: liubinyy    时间: 2005-6-28 18:09
标题: 测试中从datapool中读取数据的问题,只能读取第一行的数据???
''$Include"sqautil.sbh"

Sub Main
    Dim Result As Integer
    Dim x As Integer
    Dim num1 as string
    Dim dp as long

    'Initially Recorded: 2005-6-28  14:32:58
    'Script Name: ZXT2382_050628_06
    StartApplication """C:\Program Files\ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾\ZXT2382(V1.0)ÉÏλ»úÈí¼þ\ZXTICT\bin\ZXT_ICT.exe"""
      
    Window SetContext, "Caption=ZXT_ICT", ""
    InputKeys "{ENTER}"
   
    Window SetContext, "Caption=ZXT_ICT", ""
    InputKeys "{ENTER}"
   
    Window SetTestContext, "Caption=»¶Ó­½øÈë", ""
    Result = PushButtonVP (CompareProperties, "Text=´ò¿ª×î½ü²âÊÔ³ÌÐò(R)", "VP=Object Properties;Wait=2,30")
    Window ResetTestContext, "", ""
   
    Window SetContext, "Caption=»¶Ó­½øÈë", ""
    PushButton Click, "Text=´ò¿ª×î½ü²âÊÔ³ÌÐò(R)"
    Result = WindowVP (CompareMenu, "Caption=ÖÐÐËÔÚÏß²âÊÔ - Êä³ö´°¿Ú1", "VP=Menu;Wait=2,30")
   
    Window SetContext, "Caption=ÖÐÐËÔÚÏß²âÊÔ - Êä³ö´°¿Ú1", ""
    MenuSelect "Îļþ(F)->¹Ø±Õ²âÊÔ"
    Result = WindowVP (CompareMenu, "Caption=ÖÐÐËÔÚÏß²âÊÔ", "VP=Menu2;Wait=2,30")
      
    MenuSelect "Îļþ(F)->1 E:\ZXT2382²âÊÔ\liubin\050614"
    DelayFor (6000)
    MenuSelect "´°¿Ú(W)->1 050614"
   
    Window SetContext, "Caption=050614;ChildWindow", ""
    TreeView Click, "ObjectIndex=1;\;ItemText=TestProj->TVSV", "Location=Button"
    TreeView Click, "ObjectIndex=1;\;ItemText=TestProj->TVSV->TVSV", "Location=Button"
    TreeView DblClick, "ObjectIndex=1;\;ItemText=TestProj->TVSV->TVSV->1", "Location=Icon"
    PlayJrnl ("001")
   
    Window SetContext, "Caption=ÖÐÐËÔÚÏß²âÊÔ - TVSV/TVSV/1", ""
   
    dp=SQADatapoolOpen("ZXT2382")

    for x=1 to 100
    Call SQADatapoolFetch(dp)
    Call SQADatapoolValue(dp,1,num1)
   
    Window SetContext, "Caption=TVSV/TVSV/1;ChildWindow", ""
    InputKeys num1
    DelayFor (2000)
    Window CloseWin, "", ""
   
    Window SetContext, "Caption=ZXT_ICT", ""
    PushButton Click, "Text=ÊÇ(Y)"
   
    Window SetContext, "Caption=ÖÐÐËÔÚÏß²âÊÔ - Êä³ö´°¿Ú2", ""
    MenuSelect "´°¿Ú(W)->1 050614"
    MenuSelect "Îļþ(F)->¹Ø±Õ²âÊÔ"
   
    next x
    Call SQADatapoolClose(dp)
   
    MenuSelect "Îļþ(F)->Exit"
   
   

End Sub
作者: jacky8024    时间: 2005-6-29 10:21
不是啊,你脚本有问题吧
作者: floatingleaf    时间: 2005-6-29 15:54
应该加上For 循环语句




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