51Testing软件测试论坛

标题: 求助:回放结果总是提示Unexpected Active Windows falure!如何解决? [打印本页]

作者: wei_mengxin    时间: 2005-12-27 12:29
标题: 求助:回放结果总是提示Unexpected Active Windows falure!如何解决?
求助:在GUI Playback Option中设置如下图:

按设置应该跳过这个Unexpected Active Windows继续执行,可还是出现
回放结果提示Unexpected Active Windows falure!请版主,高手指教,如何解决?
作者: ilovejolly    时间: 2005-12-27 13:56
首先你要搞清楚这个window是怎么样出现的,你当前脚本执行的window对象是否还在
作者: wei_mengxin    时间: 2005-12-27 14:32
回放时,正常启动应用程序后,就停止了。而在记录脚本时,此时我的操作是点击主菜单中一个子菜单!
作者: ilovejolly    时间: 2005-12-27 14:51
如果说你的脚本是要去选一个子菜单然后跳到另外一个页面,而回放的时候没有达到这个目的,那是你脚本有问题
作者: wei_mengxin    时间: 2005-12-27 16:52
点击主菜单中的那个子菜单后,应该弹出一个对话框!请版主指教:代码如下


Sub Main
    Dim Result As Integer

    'Initially Recorded: 2005-12-27  10:25:31
    'Script Name: ÍøÂç¼à¿Ø×Óϵͳ
    StartApplication """C:\Program Files\MetarNet\CUNICOM\ÍøÂç¼à¿Ø×Óϵͳ.exe"""
    DelayFor (10000)
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
   
    Window SetContext, "Name=frmLogin;VisualText=ÍøÂç¼à¿Ø×Óϵͳ µÇ¼", ""
    InputKeys "welcome{ENTER}"
     DelayFor (10000)
    Window SetContext, "Class=ThunderForm", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
    DelayFor (2000)
    TabControl Click, "ObjectIndex=1;\;ItemIndex=1", ""
乱码部分为双字节!
作者: ilovejolly    时间: 2005-12-27 17:01
你看下脚本到哪句就不执行了
作者: wei_mengxin    时间: 2005-12-27 17:06
到      Window SetContext, "Class=ThunderForm", ""这行就不行了!
作者: ilovejolly    时间: 2005-12-27 17:22
你把你的程序传上来吧
作者: wei_mengxin    时间: 2005-12-27 18:56
Sub Main
    Dim Result As Integer

    'Initially Recorded: 2005-12-27  14:52:40
    'Script Name: Password-menu2
    StartApplication """C:\Program Files\MetarNet\CUNICOM\ÍøÂç¼à¿Ø×Óϵͳ.exe"""
    DelayFor (10000)
   
    Window SetContext, "Name=frmLogin;VisualText=ÍøÂç¼à¿Ø×Óϵͳ µÇ¼", ""
    InputKeys "welcome"
    PushButton Click, "Name=commandLogin;VisualText=µÇ¼"
   
    Window SetContext, "Class=ThunderMDIForm", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=1", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
   
    Window SetContext, "Name=frmMain;VisualText=ÔÆÄÏÁªÍ¨CDMA×ÛºÏÍø¹Üϵͳ£­ÍøÂç¼à¿Ø×Óϵͳ - [ÐÅÁî×é֯ͼ]", ""
   
    Window SetContext, "Name=frmViewSignalNetMap;VisualText=ÐÅÁî×é֯ͼ", ""
    GenericObject Click, "Name=Map1", "Coords=138,65"
    GenericObject Click, "Name=Map1", "Coords=134,65"
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
    TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
    DelayFor (10000)
    TabControl Left_Drag, "ObjectIndex=1;\;ItemIndex=0", "Coords=106,9,200,13"
    TabControl Click, "ObjectIndex=1;\;ItemIndex=1", ""
    DelayFor (10000)
   
    Window SetContext, "Name=frmMain;VisualText=ÔÆÄÏÁªÍ¨CDMA×ÛºÏÍø¹Üϵͳ£­ÍøÂç¼à¿Ø×Óϵͳ - [ÐÅÁî×é֯ͼ]", ""
    DelayFor (10000)
    Window Click, "", "Coords=181,-17"
    GenericObject Click, "Text=DockTop", "Coords=27,7"
   
    Window SetContext, "Class=ddPopup", "Activate=0"
    Window Click, "", "Coords=58,86"
    DelayFor (10000)
    Window SetContext, "Name=frmMain;VisualText=ÔÆÄÏÁªÍ¨CDMA×ÛºÏÍø¹Üϵͳ£­ÍøÂç¼à¿Ø×Óϵͳ - [ÐÅÁî×é֯ͼ]", ""
    DelayFor (10000)
    Window SetContext, "Name=FrmSecumodifyuserpw;VisualText=ÐÞ¸ÄÓû§¿ÚÁî", ""
    InputKeys "welcome"
    EditBox Click, "Name=txtUserPW1", "Coords=17,3"
    EditBox Left_Drag, "Name=txtOldPw", "Coords=31,5,-13,7"
    InputKeys "^c"
   
    Window SetContext, "Class=myXWndClass", ""
    Window Click, "", "Coords=2,4"
   
    Window SetContext, "Name=frmMain;VisualText=ÔÆÄÏÁªÍ¨CDMA×ÛºÏÍø¹Üϵͳ£­ÍøÂç¼à¿Ø×Óϵͳ - [ÐÅÁî×é֯ͼ]", ""
    DelayFor (10000)
    Window SetContext, "Name=FrmSecumodifyuserpw;VisualText=ÐÞ¸ÄÓû§¿ÚÁî", ""
    EditBox Click, "Name=txtUserPW1", "Coords=9,5"
    InputKeys "^v"
    EditBox Left_Drag, "Name=txtUserPW1", "Coords=79,3,-135,7"
    InputKeys "welcome"
    EditBox Left_Drag, "Name=txtUserPW1", "Coords=41,5,-63,3"
    InputKeys "^c"
    EditBox Click, "Name=txtUserPW2", "Coords=69,3"
    InputKeys "^v"
    PushButton Click, "Name=cmdCancel;VisualText=È¡Ïû(&C)"
   
    Window SetContext, "Name=frmMain;VisualText=ÔÆÄÏÁªÍ¨CDMA×ÛºÏÍø¹Üϵͳ£­ÍøÂç¼à¿Ø×Óϵͳ - [ÐÅÁî×é֯ͼ]", ""
    GenericObject Click, "Text=DockTop", "Coords=1019,11"
    Window CloseWin, "", ""
   
    Window SetContext, "Caption=Òƶ¯ÍøÍø¹Üϵͳ", ""
    PushButton Click, "Text=ÊÇ(Y)"

End Sub
作者: ilovejolly    时间: 2005-12-28 09:22
是你的C:\Program Files\MetarNet\CUNICOM\ÍøÂç¼à¿Ø×Óϵͳ.exe这个程序,不是你的脚本
作者: wei_mengxin    时间: 2005-12-28 12:50
多谢版主了, 还有我想测试主菜单,可插入验证点“MENU”后,拖动小手到菜单处,无论怎样重复,都提示没有捕捉到对象。不知道为什么?我用同样方法测试Office 也不行,但Acrobat5.0,画图和笔记本都可以!
作者: bb64844866    时间: 2007-3-16 12:03
上传附件时点击按钮后,会弹出窗口,但是在回放时无法识别!提示 "unexcepted active window"
请高手指教!!!




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