51Testing软件测试论坛

标题: 有关验证点的问题 [打印本页]

作者: mini_yun    时间: 2005-8-9 10:56
标题: 有关验证点的问题
下面是我写的脚步用来验证窗口是否存在:

Sub Main
    Dim Result As Integer

    'Initially Recorded: 8/5/2005  3:05:35 PM
    'Script Name: Test
   
    'Start Application
    StartApplication """C:\Program Files\Rational\Rational Test\Sample Applications\Classics Online\ClassicsA.exe"""
   
    Window SetContext, "Name=frmExistingLogin", ""
    PushButton Click, "Name=cmdOK"
   
    Window SetContext, "Name=frmMain", ""
    PushButton Click, "Name=cmdOrder"
   
    Window SetContext, "Name=frmOrder", ""
    EditBox Left_Drag, "Name=txtCreditCard", "Coords=95,7,-23,5"
    InputKeys "11111222233334444"
    EditBox Left_Drag, "Name=txtExpirationDate", "Coords=17,11,-39,5"
    InputKeys "1212"
    PushButton Click, "Name=cmdOrder"
   
    'Verify window existence
    Result = WindowVP (Exists, "Name=frmConfirm", "VP=Window Existence")
   
    Window SetContext, "Name=frmConfirm", ""
    PushButton Click, "Name=cmdOK"
   
    'Verify window existence
   'Result = WindowVP (Exists, "Name=frmConfirm", "VP=Window Existence")
   
    Window SetContext, "Name=frmMain", ""
    MenuSelect "File->Exit"
   
End Sub


我发觉验证的这个语句:Result = WindowVP (Exists, "Name=frmConfirm", "VP=Window Existence")
放在窗口出来之后或者窗口消失以后,验证的结果都是一样的,不知道脚本有没有什么问题。等待回复。谢谢!
作者: ilovejolly    时间: 2005-8-9 11:59
请问为什么要用name这个属性,是不是唯一的?
作者: ilovejolly    时间: 2005-8-9 12:05
Sub Main
    Dim Result As Integer
   Result = WindowVP (Exists, "Caption=about:blank - Microsoft Internet Explorer", "VP=Window Existence")
     msgbox result
End Sub

请运行我这个脚本,看下打开一个空白ie和不开时分别是什么结果。
作者: mini_yun    时间: 2005-8-9 12:10
一种是failed,一种是弹出对话框。

Originally posted by ilovejolly at 2005-8-9 12:05 PM:
Sub Main
    Dim Result As Integer
   Result = WindowVP (Exists, "Caption=about:blank - Microsoft Internet Explorer", "VP=Window Existence")
     msgbox result
End Sub

请 ...

作者: mini_yun    时间: 2005-8-9 12:14
我是用插入验证点时,自动生成的,这个name应该是唯一的吧。
我测试的这个程序就是robot自带的Test Sample ->ClassicsA

Originally posted by ilovejolly at 2005-8-9 11:59 AM:
请问为什么要用name这个属性,是不是唯一的?

作者: ilovejolly    时间: 2005-8-9 12:18
两种情况都会有对话框出来,一个是1,一个是0(这个可能要等半天)

我没有找到这个自带的sample,不好意思,可能是我没装

[ Last edited by ilovejolly on 2005-8-9 at 14:00 ]
作者: DontTest    时间: 2005-8-17 16:49
Please debug you scripts step by step . you will find the really issue.
Thanks




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