51Testing软件测试论坛

标题: QTP检查点问题请教! [打印本页]

作者: dhleelei    时间: 2007-12-17 11:29
标题: QTP检查点问题请教!
在QTP专家视图中编写一个测试Windows自带计算器的脚本,做0~9个位数遍历加法计算,脚本如下(先将计算器对象和其自对象加入到对象仓库中):

        SystemUtil.Run "C:\WINDOWS\system32\calc.exe","","C:\WINDOWS\system32","open"

    Dim  x
        Dim  y
        Dim result
       
        For x=0 to 9
                For y=0  to 9

                  Window("计算器").WinButton("text:=" & x).Click
                  Window("计算器").WinButton("+").Click
                         Window("计算器").WinButton("text:=" & y).Click
                        Window("计算器").WinButton("=").Click

                        result = x+y
                   ' Window("计算器").WinEdit("Edit").Check CheckPoint("Edit")
                         Window("计算器").WinEdit("Edit").SetCaretPos 3
                next
        next
        Window("计算器").Close

问题:如何将x+y的结果传给CheckPoint("Edit")里面的Edit??谢谢!
作者: joseph_wh    时间: 2007-12-17 12:16
Modifying Checkpoints
      You can modify the settings of existing checkpoints. For example, you can choose to use parameters, or you can use filters to specify which image sources and links to check.

To modify a checkpoint:
      1. In the Keyword View or Expert View, right-click the checkpoint that you want to modify and select Checkpoint Properties. Alternatively, select the step containing the checkpoint and choose Edit > Step Properties > Checkpoint Properties. The relevant checkpoint dialog box opens.
      2. Modify the properties and click OK. The constant value of property is used to be replaced by expressions to fit in with changing.
作者: dhleelei    时间: 2007-12-18 11:36
标题: 能否再解释清楚一些?还是不太明白啊...

作者: pxwcypx    时间: 2007-12-18 12:50
你可以用文本输出检查点,然后参数化下text属性点就ok




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