|
对于window里的计算器,我设置了只打开C:\WINDOWS\system32\calc.exe测这个应用程序,然后在expert view里写了这么一段:
Dim a, b
a = RandomNumber(0,9)
b = RandomNumber(0,9)
Window("Calculator").WinButton("text:=a").Click
Window("Calculator").WinButton("+").Click
Window("Calculator").WinButton("text:=b").Click
Window("Calculator").WinButton("=").Click
Window("Calculator").Close
可是运行到红色那一行就出错了,错误提示以下两种都碰到过:
Cannot find the "[ WinButton ]" object's parent "[ Window ]" (class Window). Verify that parent properties match an object currently displayed in your application.
Cannot identify the object "[WinButton]" (of class WinButton). Verify that this object's properties match an object currently displayed in your application.
这是为什么呢?我是想让calc程序随机点两个数进行相加,winbutton这里用了描述性编程,我觉得应该没错呀,可是就是有问题。。。 |
|