51Testing软件测试论坛

标题: 头文件引用错误,请求急援! [打印本页]

作者: billrub    时间: 2004-10-7 21:56
标题: 头文件引用错误,请求急援!
我在录制了一段脚本后,并引入datapool,也对“sqautil.sbh”进行了头文件引用说明,可依然出现了错误:
对“sqautil.sbh”文件中的一系列DECLARE语句指出了同一错误“ILLEGAL STATEMENT!”
望高手不吝赐教!
作者: hxf    时间: 2004-10-8 13:26
请把你的脚本和错误写清楚。
作者: billrub    时间: 2004-10-8 15:28
标题: 脚本
Sub Main
    '$Include "SQAUTIL.SBH"
    Dim Result As Integer
    dim x as integer
    dim dp as long
    dim user as string
    dim pw as string
    dp = sqadatapoolopen("test");
    for x =1 to 5
    call sqadatapoolfetch(dp)
    call sqadatapoolvalue(dp,1,user)
    call sqadatapoolvalue(dp,2,pw)

    'Initially Recorded: 2004-9-27  10:14:08
    'Script Name: new1
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    Toolbar Click, "ObjectIndex=2;\;ItemText=Æô¶¯ Internet Explorer ä¯ÀÀÆ÷", "Coords=8,16"
   
    Window SetContext, "Caption=about:blank - Microsoft Internet Explorer", ""
    ComboBox Click, "ObjectIndex=4", "Coords=830,4"
    ComboListBox VScrollTo, "ObjectIndex=4", "Position=1"
    ComboListBox Click, "ObjectIndex=4", "ItemData=1731544"
    Browser SetFrame,"Type=HTMLFrame;HTMLId=mainFrame",""
    Browser NewPage,"HTMLTitle=¾­¼Ã»§¿Ú×ۺϹÜÀí-¼à¹Üϵͳ",""
    EditBox Click, "Type=EditBox;Name=loginName", "Coords=40,11"
    InputKeys user
    HTMLTable Click, "Type=HTMLTable;Index=3", "Row=1;Col=4"
    EditBox Click, "Type=EditBox;Name=password", "Coords=66,9"
    InputKeys pw
    PushButton Click, "Type=PushButton;Name=Submit"
    Window CloseWin, "", ""
    next x
    call sqadatapoolclose(dp)
End Sub
作者: billrub    时间: 2004-10-8 15:29
标题: 错误
以下是错误提示:
Compiling new1.rec...
SQAUTIL.SBH(5) Error: Illegal statement
SQAUTIL.SBH(17) Error: Illegal statement
SQAUTIL.SBH(18) Error: Illegal statement
SQAUTIL.SBH(20) Error: Illegal statement
SQAUTIL.SBH(21) Error: Illegal statement
SQAUTIL.SBH(23) Error: Illegal statement
SQAUTIL.SBH(25) Error: Illegal statement
SQAUTIL.SBH(26) Error: Illegal statement
SQAUTIL.SBH(27) Error: Illegal statement
SQAUTIL.SBH(28) Error: Illegal statement
SQAUTIL.SBH(30) Error: Illegal statement
SQAUTIL.SBH(31) Error: Illegal statement
SQAUTIL.SBH(32) Error: Illegal statement
SQAUTIL.SBH(35) Error: Illegal statement
new1.rec(9) Error: Variable sqadatapoolopen undefined
new1.rec(11) Error: Unknown function: sqadatapoolfetch
new1.rec(12) Error: Unknown function: sqadatapoolvalue
new1.rec(13) Error: Unknown function: sqadatapoolvalue
new1.rec(35) Error: Unknown function: sqadatapoolclose
0 warning(s), 19 error(s)
作者: pcl2004_27    时间: 2004-10-10 11:00
你把头文件放在了脚本中,应该修改为

'$Include "SQAUTIL.SBH"   

Sub Main
        Dim Result As Integer
    dim x as integer
    dim dp as long
    dim user as string
    dim pw as string
    dp = sqadatapoolopen("test");
    for x =1 to 5
    call sqadatapoolfetch(dp)
    call sqadatapoolvalue(dp,1,user)
    call sqadatapoolvalue(dp,2,pw)

    'Initially Recorded: 2004-9-27  10:14:08
    'Script Name: new1
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    Toolbar Click, "ObjectIndex=2;\;ItemText=Æô¶¯ Internet Explorer ä¯ÀÀÆ÷", "Coords=8,16"
   
    Window SetContext, "Caption=about:blank - Microsoft Internet Explorer", ""
    ComboBox Click, "ObjectIndex=4", "Coords=830,4"
    ComboListBox VScrollTo, "ObjectIndex=4", "Position=1"
    ComboListBox Click, "ObjectIndex=4", "ItemData=1731544"
    Browser SetFrame,"Type=HTMLFrame;HTMLId=mainFrame",""
    Browser NewPage,"HTMLTitle=¾­¼Ã»§¿Ú×ۺϹÜÀí-¼à¹Üϵͳ",""
    EditBox Click, "Type=EditBox;Name=loginName", "Coords=40,11"
    InputKeys user
    HTMLTable Click, "Type=HTMLTable;Index=3", "Row=1;Col=4"
    EditBox Click, "Type=EditBox;Name=password", "Coords=66,9"
    InputKeys pw
    PushButton Click, "Type=PushButton;Name=Submit"
    Window CloseWin, "", ""
    next x
    call sqadatapoolclose(dp)
End Sub
作者: billrub    时间: 2004-10-10 12:11
thks
作者: xiang0522    时间: 2005-3-24 15:30
终于知道错误的原因了!谢谢!




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