51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

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

[Robot] 参数化后运行,跳出录制的程序。但马上转到TestManager,日志信息为Warning

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-3-1 14:56:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
版本: Rational RobotV7.0(从verycd.com上下的)
所测程序:QTP的飞机订票系统

录制好后回放成功,但参数化后运行,跳出录制的程序。接着马上转到TestManager,日志信息为Warning
右击playback warning信息,显示:“Unhandled Exception detected during playback. Robot stopped playing back”。

在IBM的官网上查到如下信息,但据它所说的是sqadatapoolclose()的问题,并不如此。
  
Error: Unhandled exception detected during playback. Robot stopped playing back
  
Technote (troubleshooting)
  
Problem(Abstract)
This technote explains how to resolve an unhandled exception that might occur when running IBM® Rational® Robot script with a TestManager datapool.  
  
Symptom
Robot script with a TestManager datapool runs for a second, then TestManager log brings up the following error:


Unhandled exception detected during playback. Robot stopped playing back  
  



Cause
Datapool corruption is one common root cause of this exception. However, other playback scenarios might also produce the same error message.  
  

Resolving the problem
To resolve this error, ensure SQADatapoolClose() is called whenever SQADatapoolOpen() is used in Robot scripts. Specifically each SQADatapoolOpen() call must be followed by SQADatapoolClose(). This would proven Datapool corruption and this unhandled exception. Please contact IBM® Rational Support if there are questions.

录制编写的程序脚本如下:

'$include "sqautil.sbh"
Sub Main
    Dim Result As Integer
    dim i as integer
    dim dp as long
    dim uname as string
    dim num as string

    'Initially Recorded: 2009-3-1  13:49:02
    'Script Name: t3
    for i=1 to 3
    StartApplication """C:\Disk_I\ForWork\Mercury\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"""
    dp=SQADatapoolOpen("1")
    call SQADatapoolFetch(dp)
    call SQADatapoolValue(dp,1,uname)
    call SQADatapoolValue(dp,2,num)
    call SQADatapoolClose(dp)
    Window SetContext, "Caption=Login", ""
    InputKeys uname
    EditBox Click, "ObjectIndex=2", "Coords=9,9"
    InputEncKeys "CAAAAM4AAAAICaEYwet4JA=="
    PushButton Click, "Text=OK"
   
    Window SetContext, "Caption=Flight Reservation", ""
    InputKeys "101010"
    ComboBox Click, "ObjectIndex=1", "Coords=99,9"
    ComboListBox Click, "ObjectIndex=1", "Text=Los Angeles"
    ComboBox Click, "ObjectIndex=2", "Coords=89,4"
    ComboListBox Click, "ObjectIndex=2", "Text=Seattle"
    PushButton Click, "Text=FLIGHT"
   
    Window SetContext, "Caption=Flights Table", ""
    PushButton Click, "Text=OK"
   
    Window SetContext, "Caption=Flight Reservation", ""
    InputKeys "syy"
    RadioButton Click, "Text=First"
    EditBox Left_Drag, "ObjectIndex=2", "Coords=13,12,-23,9"
    InputKeys num
    PushButton Click, "Text=Insert Order"
    'call sqadatapoolclose(dp)
    Window CloseWin, "", ""
   
    next

End Sub


或许是破解的问题,盼请高手予以指点

附截图:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2009-3-3 12:24:54 | 只看该作者

回复一个我录制的,供参考

'$Include "sqautil.sbh"
Sub Main
    Dim Result As Integer

    dim username as string
    dim password as string
    dim i as integer
    dim dp as long
   
   
    'Initially Recorded: 2009-3-2  15:08:53
    'Script Name: sample
    startapplication "D:\Program Files\qtp\samples\flight\app\flight4a.exe"
   
    dp=SQADatapoolOpen("login")
   
    for i= 1 to 2
    call SQADatapoolFetch(dp)
    call SQADatapoolValue(dp,1,username)
    'CallScript "test2"
    call SQADatapoolValue(dp,1,password)
    SQAConsoleWrite "username is :"&username
    SQAConsoleWrite "password is :"&password
    Window SetContext, "Caption=Login", ""
    InputKeys username
    EditBox Click, "ObjectIndex=2", "Coords=26,2"
    InputKeys password
    PushButton Click, "Text=OK"
   
    Result = PushButtonVP(CompareText, "Text=OK", "VP=Alphanumeric;Type=CaseInsensitive")
   
    Window SetTestContext, "Caption=Login", ""
   
    Window ResetTestContext, "", ""
   
   
   
   
    Window SetContext, "Caption=Flight Reservations", ""
    Result=SQAWaitForPropertyvalue("Text=确定","Enabled",True,2000)
   
    if Result<>sqaSuccess then
       SQAConsoleWrite "确定按钮没有出现"
      
       Window SetContext, "Caption=Flight Reservation", ""
       Window CloseWin, "", ""

    else
   
       SQAConsoleWrite "确定按钮出现"
       PushButton Click,"Text=确定"
       Window SetContext, "Caption=Login", ""
       EditBox Click, "ObjectIndex=1", "Coords=47,6"
       InputKeys "{BKSP}{BKSP}{BKSP}{BKSP}{BKSP}{BKSP}{BKSP}{BKSP}"
    end if
            
    next
    Call SQADatapoolClose(dp)
End Sub
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

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

GMT+8, 2024-9-20 09:35 , Processed in 0.092135 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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