|
SystemUtil.Run "C:\WINDOWS\system32\calc.exe","","C:\WINDOWS\system32","open"
Window("regexpwndtitle:=计算器","regexpwndclass:=scicalc").Activate
With Window("regexpwndtitle:=计算器","regexpwndclass:=scicalc")
.WinButton("text:=2","object class:=button").Click
.WinButton("text:= \+","object class:=button").Click
.WinButton("text:=1","object class:=button").Click
End With
For Iterator = 1 To 3 Step 1
Window("regexpwndtitle:=计算器","regexpwndclass:=scicalc").WinButton("text:==","object class:=button").Click
Next
Dim iResult
Set Result=Window("regexpwndtitle:=计算器","regexpwndclass:=scicalc").WinEdit("nativeclass:=Edit","object class:=Edit")
iResult=Cint(Result.GetROProperty("nativeclass:=Edit","object class:=Edit"))
If iResult=5 Then
Reporter.ReportEvent micPass,"ASS" ,"输出正确"
Else
Reporter.ReportEvent micPass,"NG" ,"输出错误"
End If
Window("regexpwndtitle:=计算器","regexpwndclass:=scicalc").Close
里面的iResult 一直等不到 5 这个数字 只能取到0 说明iResult=Cint(Result.GetROProperty("nativeclass:=Edit","object class:=Edit"))
这个函数只是做了无用功 更本没有得到计算器中最后加的结果5.
不知道是我写错了,还是有什么特殊取法 求教下.... |
|